本企业信息接口优化

cert
schry 2 years ago
parent 4e7bc6a290
commit 27bc37de63

@ -24,6 +24,7 @@ import org.springframework.web.context.request.ServletRequestAttributes;
import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.util.Date;
import java.util.List;
/**
@ -90,6 +91,23 @@ public class userPersonController {
return ResultVOUtils.success();
}
@ApiOperation(value = "新增本企业负责人信息", response = BaseResponse.class)
@PostMapping("/sup/company/person/addPerSon")
public BaseResponse addPerSon(@RequestBody UserPersonFilterRequest userPersonFilterRequest ,BindingResult bindingResult ){
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
UserPersonEntity userPerson = new UserPersonEntity();
BeanUtils.copyProperties(userPersonFilterRequest,userPerson);
userPerson.setPassword(userPersonFilterRequest.getCheckPassword());
userPerson.setCompanyId(Long.valueOf(userPersonFilterRequest.getCompanyId()));
// userPerson.setId(Long.valueOf(Long.parseLong(userPersonFilterRequest.getCompanyId())));
userPerson.setCreateTime(new Date());
userPersonService.add(userPerson);
return ResultVOUtils.success();
}
public String getCompanyId() {
ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
if (attributes == null) {
@ -101,4 +119,5 @@ public class userPersonController {
}
}

@ -24,4 +24,9 @@ public class UserPersonService extends ServiceImpl<UserPersonMapper, UserPersonE
public boolean delete(UserPersonEntity userPerson) {
return userPersonMapper.deleteById(userPerson) > 0;
}
public boolean add(UserPersonEntity userPerson) {
return userPersonMapper.insert(userPerson)> 0;
}
}

Loading…
Cancel
Save