|
|
@ -31,6 +31,7 @@ import com.elink.esua.epdc.dto.enterprise.result.EnterpriseInfoResultDTO; |
|
|
|
import com.elink.esua.epdc.dto.form.CompleteRequisiteInfoDTO; |
|
|
|
import com.elink.esua.epdc.modules.enterprise.excel.EnterpriseInfoExcel; |
|
|
|
import com.elink.esua.epdc.modules.enterprise.service.EnterpriseInfoService; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.web.bind.annotation.*; |
|
|
|
|
|
|
@ -48,24 +49,24 @@ import java.util.Map; |
|
|
|
@RestController |
|
|
|
@RequestMapping("enterpriseinfo") |
|
|
|
public class EnterpriseInfoController { |
|
|
|
|
|
|
|
|
|
|
|
@Autowired |
|
|
|
private EnterpriseInfoService enterpriseInfoService; |
|
|
|
|
|
|
|
@GetMapping("page") |
|
|
|
public Result<PageData<EnterpriseInfoDTO>> page(@RequestParam Map<String, Object> params){ |
|
|
|
public Result<PageData<EnterpriseInfoDTO>> page(@RequestParam Map<String, Object> params) { |
|
|
|
PageData<EnterpriseInfoDTO> page = enterpriseInfoService.page(params); |
|
|
|
return new Result<PageData<EnterpriseInfoDTO>>().ok(page); |
|
|
|
} |
|
|
|
|
|
|
|
@GetMapping("{id}") |
|
|
|
public Result<EnterpriseInfoDTO> get(@PathVariable("id") String id){ |
|
|
|
public Result<EnterpriseInfoDTO> get(@PathVariable("id") String id) { |
|
|
|
EnterpriseInfoDTO data = enterpriseInfoService.get(id); |
|
|
|
return new Result<EnterpriseInfoDTO>().ok(data); |
|
|
|
} |
|
|
|
|
|
|
|
@PostMapping |
|
|
|
public Result save(@RequestBody EnterpriseInfoDTO dto){ |
|
|
|
public Result save(@RequestBody EnterpriseInfoDTO dto) { |
|
|
|
//效验数据
|
|
|
|
ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); |
|
|
|
enterpriseInfoService.save(dto); |
|
|
@ -73,7 +74,7 @@ public class EnterpriseInfoController { |
|
|
|
} |
|
|
|
|
|
|
|
@PutMapping |
|
|
|
public Result update(@RequestBody EnterpriseInfoDTO dto){ |
|
|
|
public Result update(@RequestBody EnterpriseInfoDTO dto) { |
|
|
|
//效验数据
|
|
|
|
ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); |
|
|
|
enterpriseInfoService.update(dto); |
|
|
@ -81,7 +82,7 @@ public class EnterpriseInfoController { |
|
|
|
} |
|
|
|
|
|
|
|
@DeleteMapping |
|
|
|
public Result delete(@RequestBody String[] ids){ |
|
|
|
public Result delete(@RequestBody String[] ids) { |
|
|
|
//效验数据
|
|
|
|
AssertUtils.isArrayEmpty(ids, "id"); |
|
|
|
enterpriseInfoService.delete(ids); |
|
|
@ -106,29 +107,31 @@ public class EnterpriseInfoController { |
|
|
|
public Result completeRequisiteInfo(@RequestBody CompleteRequisiteInfoDTO fromDto) { |
|
|
|
return enterpriseInfoService.completeRequisiteInfo(fromDto); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 企业信息完善 |
|
|
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|
|
|
* @Description 企业信息完善 |
|
|
|
* @Author songyunpeng |
|
|
|
* @Date 2020/2/28 |
|
|
|
* @Date 2020/2/28 |
|
|
|
* @Param [dto] |
|
|
|
* @return com.elink.esua.epdc.commons.tools.utils.Result |
|
|
|
**/ |
|
|
|
@GetMapping("completeSelectiveInfo") |
|
|
|
public Result completeEnterpriseInfo(@RequestBody EnterpriseInfoFormDTO dto){ |
|
|
|
public Result completeEnterpriseInfo(@RequestBody EnterpriseInfoFormDTO dto) { |
|
|
|
ValidatorUtils.validateEntity(dto); |
|
|
|
enterpriseInfoService.completeEnterpriseInfo(dto); |
|
|
|
return new Result().ok(true); |
|
|
|
} |
|
|
|
|
|
|
|
/** |
|
|
|
* @Description 查询企业信息 |
|
|
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.enterprise.result.EnterpriseInfoResultDTO> |
|
|
|
* @Description 查询企业信息 |
|
|
|
* @Author songyunpeng |
|
|
|
* @Date 2020/2/28 |
|
|
|
* @Date 2020/2/28 |
|
|
|
* @Param [userId] |
|
|
|
* @return com.elink.esua.epdc.commons.tools.utils.Result<com.elink.esua.epdc.dto.enterprise.result.EnterpriseInfoResultDTO> |
|
|
|
**/ |
|
|
|
@GetMapping("getByUserId/{userId}") |
|
|
|
public Result<EnterpriseInfoResultDTO> getEnterpriseInfoByUserId(@PathVariable("userId") String userId){ |
|
|
|
if(userId==null){ |
|
|
|
public Result<EnterpriseInfoResultDTO> getEnterpriseInfoByUserId(@PathVariable("userId") String userId) { |
|
|
|
if (StringUtils.isBlank(userId)) { |
|
|
|
return new Result().error("用户ID为空"); |
|
|
|
} |
|
|
|
EnterpriseInfoResultDTO enterpriseInfoDTO = enterpriseInfoService.selectOneEnterpriseInfo(userId); |
|
|
|