20200429-zlp-1

园历展示新增员工生日和入职日期
This commit is contained in:
paidaxing444
2020-04-29 17:39:18 +08:00
parent 39371fe365
commit 619477a4fe
3 changed files with 66 additions and 13 deletions

View File

@ -48,7 +48,7 @@
</el-form> </el-form>
<!-- 底部 --> <!-- 底部 -->
<div class="el-login-footer"> <div class="el-login-footer">
<span>Copyright © 2018-2019 ruoyi.vip All Rights Reserved.</span> <span>Copyright © 2018-2019 benyiedu.com All Rights Reserved.</span>
</div> </div>
</div> </div>
</template> </template>
@ -65,8 +65,8 @@ export default {
codeUrl: "", codeUrl: "",
cookiePassword: "", cookiePassword: "",
loginForm: { loginForm: {
username: "admin", username: "",
password: "admin123", password: "",
rememberMe: false, rememberMe: false,
code: "", code: "",
uuid: "" uuid: ""
@ -148,7 +148,7 @@ export default {
justify-content: center; justify-content: center;
align-items: center; align-items: center;
height: 100%; height: 100%;
background-image: url("../assets/image/login-background.jpg"); background: linear-gradient(-45deg,#46a6ff,#edf7fb);
background-size: cover; background-size: cover;
} }
.title { .title {

View File

@ -8,6 +8,8 @@ import java.util.List;
import com.ruoyi.common.utils.SecurityUtils; import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.project.benyi.domain.ByThings; import com.ruoyi.project.benyi.domain.ByThings;
import com.ruoyi.project.common.SchoolCommon; import com.ruoyi.project.common.SchoolCommon;
import com.ruoyi.project.system.domain.ByTeacherJbxx;
import com.ruoyi.project.system.service.IByTeacherJbxxService;
import com.ruoyi.project.system.service.ISysDictDataService; import com.ruoyi.project.system.service.ISysDictDataService;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
@ -43,6 +45,8 @@ public class BySchoolcalendarController extends BaseController {
private SchoolCommon schoolCommon; private SchoolCommon schoolCommon;
@Autowired @Autowired
private ISysDictDataService dictDataService; private ISysDictDataService dictDataService;
@Autowired
private IByTeacherJbxxService byTeacherJbxxService;
/** /**
* 查询园历管理列表 * 查询园历管理列表
@ -63,9 +67,14 @@ public class BySchoolcalendarController extends BaseController {
public AjaxResult getSchoolCalendars(BySchoolcalendar bySchoolcalendar) { public AjaxResult getSchoolCalendars(BySchoolcalendar bySchoolcalendar) {
AjaxResult ajax = AjaxResult.success(); AjaxResult ajax = AjaxResult.success();
bySchoolcalendar.setXnxq(schoolCommon.getCurrentXn()); bySchoolcalendar.setXnxq(schoolCommon.getCurrentXn());
//系统内设置的园历信息
List<BySchoolcalendar> list = bySchoolcalendarService.selectBySchoolcalendarList(bySchoolcalendar); List<BySchoolcalendar> list = bySchoolcalendarService.selectBySchoolcalendarList(bySchoolcalendar);
//系统内员工生日信息 系统内员工入职日期
ByTeacherJbxx byTeacherJbxx = new ByTeacherJbxx();
List<ByTeacherJbxx> listTeacherBirth = byTeacherJbxxService.selectByTeacherJbxxList(byTeacherJbxx);
ByThings byThings = null; ByThings byThings = null;
List<ByThings> listThings = new ArrayList<>(); List<ByThings> listThings = new ArrayList<>();
//系统内设置的园历信息
if (list != null && list.size() > 0) { if (list != null && list.size() > 0) {
for (int i = 0; i < list.size(); i++) { for (int i = 0; i < list.size(); i++) {
byThings = new ByThings(); byThings = new ByThings();
@ -81,6 +90,42 @@ public class BySchoolcalendarController extends BaseController {
} }
} }
//系统内员工的生日、入职日期信息
if (listTeacherBirth != null && listTeacherBirth.size() > 0) {
for (int i = 0; i < listTeacherBirth.size(); i++) {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
//创建一个教师实体类,并赋值
byTeacherJbxx=listTeacherBirth.get(i);
String strCurrentYear=schoolCommon.getCurrentYear();
System.out.println("当前年===" + strCurrentYear);
//参加工作日期
if(byTeacherJbxx.getCjgzrq()!=null){
byThings = new ByThings();
byThings.setYears(strCurrentYear);
System.out.println("参加工作日期==="+sdf.format(byTeacherJbxx.getCjgzrq()));
byThings.setMonths(sdf.format(byTeacherJbxx.getCjgzrq()).split("-")[1]);//2020-04-12 月
byThings.setDays(sdf.format(byTeacherJbxx.getCjgzrq()).split("-")[2]);//2020-04-12 日
byThings.setThings(listTeacherBirth.get(i).getUser().getNickName()+"-合同满年期限");
listThings.add(byThings);
}
//生日
if(byTeacherJbxx.getCsrq()!=null){
byThings = new ByThings();
byThings.setYears(strCurrentYear);
byThings.setMonths(sdf.format(byTeacherJbxx.getCsrq()).split("-")[1]);//2020-04-12 月
byThings.setDays(sdf.format(byTeacherJbxx.getCsrq()).split("-")[2]);//2020-04-12 日
byThings.setThings(listTeacherBirth.get(i).getUser().getNickName()+"-生日");
listThings.add(byThings);
}
}
}
ajax.put("calendarData", listThings); ajax.put("calendarData", listThings);
return ajax; return ajax;
} }

View File

@ -10,6 +10,7 @@ import io.swagger.models.auth.In;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.text.SimpleDateFormat;
import java.util.Calendar; import java.util.Calendar;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
@ -116,6 +117,13 @@ public class SchoolCommon {
return getCurrentXnXq().substring(0,9); return getCurrentXnXq().substring(0,9);
} }
public String getCurrentYear() {
SimpleDateFormat sdf = new SimpleDateFormat("yyyy");
Date date = new Date();
return sdf.format(date);
}
public boolean isStringEmpty(String str) { public boolean isStringEmpty(String str) {
if (str == null || "".equals(str)) { if (str == null || "".equals(str)) {
return true; return true;