Commit 6afdeaa8 authored by chenzhao's avatar chenzhao

Merge branch 'chenhao' of http://172.16.10.76/moa/amos-boot-biz into chenhao

parents 6fab1d04 c0c7fe10
......@@ -155,7 +155,7 @@ public class DateUtils {
* @throws ParseException
*/
public static String dateFormat(Date date, String pattern) throws ParseException {
if (StringUtils.isNotEmpty(pattern)) {
if (StringUtils.isEmpty(pattern)) {
pattern = DateUtils.DATE_PATTERN;
}
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
......@@ -203,7 +203,7 @@ public class DateUtils {
* @throws ParseException
*/
public static Date dateParse(String dateTimeString, String pattern) throws ParseException {
if (StringUtils.isNotEmpty(pattern)) {
if (StringUtils.isEmpty(pattern)) {
pattern = DateUtils.DATE_PATTERN;
}
SimpleDateFormat sdf = new SimpleDateFormat(pattern);
......
......@@ -66,6 +66,7 @@ public class FirefightersPostController extends BaseController {
*
* @return
*/
@SuppressWarnings("unchecked")
@TycloudOperation(needAuth = true, ApiLevel = UserType.AGENCY)
@RequestMapping(value = "/save", method = RequestMethod.POST)
@ApiOperation(httpMethod = "POST", value = "新增岗位信息", notes = "新增岗位信息")
......@@ -73,8 +74,11 @@ public class FirefightersPostController extends BaseController {
public ResponseModel<Object> saveFirefightersPost(@RequestBody FirefightersDataDto firefightersDataDto) {
try {
/*---------修改bug:2179 解決崗位与学历可以重复添加导致的列表页展示消防人员信息呈现多条的情况 on 2021-08-21 陈浩---start*/
LambdaQueryWrapper<FirefightersPost> queryWrapper = new LambdaQueryWrapper<FirefightersPost>();
queryWrapper.eq(FirefightersPost::getFirefightersId, firefightersDataDto.getFirefightersPost().getFirefightersId());
//LambdaQueryWrapper<FirefightersPost> queryWrapper = new LambdaQueryWrapper<FirefightersPost>();
//.eq(FirefightersPost::getFirefightersId, firefightersDataDto.getFirefightersPost().getFirefightersId());
@SuppressWarnings("rawtypes")
QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("firefighters_id", firefightersDataDto.getFirefightersPost().getFirefightersId());
FirefightersPost firefightersPost = iFirefightersPostService.getOne(queryWrapper);
if (firefightersPost == null) {
......@@ -82,10 +86,21 @@ public class FirefightersPostController extends BaseController {
} else {
iFirefightersPostService.update(firefightersDataDto.getFirefightersPost(), queryWrapper);
}
// iFirefightersPostService.save(firefightersDataDto.getFirefightersPost());
FirefightersEducation firefightersEducation= ifirefightersEducationService.getOne(queryWrapper);
if(firefightersEducation==null) {
ifirefightersEducationService.save(firefightersDataDto.getFirefightersEducation());
}else {
ifirefightersEducationService.update(firefightersDataDto.getFirefightersEducation(),queryWrapper);
}
FirefightersWorkexperience firefightersWorkexperience = ifirefightersWorkexperienceService.getOne(queryWrapper);
if(firefightersWorkexperience==null) {
ifirefightersWorkexperienceService.save(firefightersDataDto.getFirefightersWorkexperience());
}else {
ifirefightersWorkexperienceService.update(firefightersDataDto.getFirefightersWorkexperience(),queryWrapper);
}
/*---------修改bug:2179 解決崗位与学历可以重复添加导致的列表页展示消防人员信息呈现多条的情况 on 2021-08-21 陈浩---end*/
ifirefightersWorkexperienceService.save(firefightersDataDto.getFirefightersWorkexperience());
ifirefightersEducationService.save(firefightersDataDto.getFirefightersEducation());
return ResponseHelper.buildResponse(null);
} catch (Exception e) {
......
......@@ -25,6 +25,7 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.yeejoin.amos.boot.biz.common.controller.BaseController;
import com.yeejoin.amos.boot.biz.common.utils.DateUtils;
import com.yeejoin.amos.boot.biz.common.utils.NameUtils;
import com.yeejoin.amos.boot.biz.common.utils.RedisKey;
import com.yeejoin.amos.boot.biz.common.utils.RedisUtils;
......@@ -163,7 +164,7 @@ public class FirefightersThoughtController extends BaseController {
}
}else if (type.equals(Date.class)) {
Date fileValue = (Date) field.get(firefightersThought);
firefightersThoughtQueryWrapper.eq(name, fileValue);
firefightersThoughtQueryWrapper.likeRight(name,DateUtils.dateFormat(fileValue,null));
} else {
if(!name.equals(NameUtils.camel2Underline("serialVersionUID"))) {
String fileValue = (String) field.get(firefightersThought);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment