Commit 8b218fe2 authored by ysongq's avatar ysongq

主键查询用户企业详情信息

parent 5468acc8
...@@ -16,5 +16,5 @@ public interface DataGoodsApiService { ...@@ -16,5 +16,5 @@ public interface DataGoodsApiService {
* @param id * @param id
* @return * @return
*/ */
DataGoodsApiDto selectById(Long goodsApi); DataGoodsApiDto selectById(Long id);
} }
\ No newline at end of file
...@@ -2,17 +2,17 @@ package com.jz.manage.moduls.controller.customer; ...@@ -2,17 +2,17 @@ package com.jz.manage.moduls.controller.customer;
import com.jz.common.bean.PageInfoResponse; import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants; import com.jz.common.constant.Constants;
import com.jz.common.utils.Result;
import com.jz.common.utils.StatusCode;
import com.jz.manage.moduls.controller.BaseController; import com.jz.manage.moduls.controller.BaseController;
import com.jz.manage.moduls.controller.customer.bean.dto.CompanyDetailsDto;
import com.jz.manage.moduls.controller.customer.bean.dto.EnterpriseAuditDto; import com.jz.manage.moduls.controller.customer.bean.dto.EnterpriseAuditDto;
import com.jz.manage.moduls.controller.customer.bean.request.EnterpriseAuditRequest; import com.jz.manage.moduls.controller.customer.bean.request.EnterpriseAuditRequest;
import com.jz.manage.moduls.service.DepartmentService; import com.jz.manage.moduls.service.DepartmentService;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping; import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
...@@ -24,7 +24,7 @@ import javax.servlet.http.HttpServletRequest; ...@@ -24,7 +24,7 @@ import javax.servlet.http.HttpServletRequest;
*/ */
@RestController @RestController
@RequestMapping("department") @RequestMapping("department")
@Api(tags = "企业") @Api(tags = "企业api")
public class DepartmentController extends BaseController { public class DepartmentController extends BaseController {
/** /**
* 服务对象 * 服务对象
...@@ -32,6 +32,13 @@ public class DepartmentController extends BaseController { ...@@ -32,6 +32,13 @@ public class DepartmentController extends BaseController {
@Autowired @Autowired
private DepartmentService departmentService; private DepartmentService departmentService;
/**
* 条件分页查询企业审核信息
* @param auditRequest
* @param req
* @return
* @throws Exception
*/
@PostMapping(value = "/findList") @PostMapping(value = "/findList")
@ApiOperation(value = "条件分页查询企业审核信息") @ApiOperation(value = "条件分页查询企业审核信息")
public PageInfoResponse<EnterpriseAuditDto> findList(@RequestBody EnterpriseAuditRequest auditRequest, HttpServletRequest req) throws Exception { public PageInfoResponse<EnterpriseAuditDto> findList(@RequestBody EnterpriseAuditRequest auditRequest, HttpServletRequest req) throws Exception {
...@@ -45,4 +52,14 @@ public class DepartmentController extends BaseController { ...@@ -45,4 +52,14 @@ public class DepartmentController extends BaseController {
} }
return pageInfo; return pageInfo;
} }
@GetMapping(value = "/{id}")
@ApiOperation(value = "主键查询用户企业详情信息")
public Result<CompanyDetailsDto> selectById(@PathVariable(value = "id") String id, HttpServletRequest req) {
if (id != null) {
CompanyDetailsDto companyDetails = departmentService.selectById(Long.valueOf(id));
return new Result<CompanyDetailsDto>(true, "查询企业详情成功!", StatusCode.OK, companyDetails);
}
return new Result<CompanyDetailsDto>(false, "查询企业详情失败!", StatusCode.ERROR);
}
} }
\ No newline at end of file
package com.jz.manage.moduls.controller.customer.bean.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @ClassName:
* @Author: Carl
* @Date: 2020/12/10
* @Version:
*/
@ApiModel(value = "企业详细信息返回参数")
public class CompanyDetailsDto {
@ApiModelProperty(value = "企业id")
private Long departmentId;
@ApiModelProperty(value = "企业名称")
private String departmentName;
@ApiModelProperty(value = "联系人姓名")
private String customerName;
@ApiModelProperty(value = "联系人电话")
private String customerPhone;
@ApiModelProperty(value = "企业地址")
private String registeredAddress;
@ApiModelProperty(value = "营业执照")
private String businessLicense;
@ApiModelProperty(value = "统一社会信用代码")
private String unifredCreditCode;
@ApiModelProperty(value = "银行卡号")
private String bankCardNubmer;
@ApiModelProperty(value = "开户行地址")
private String bankAddress;
public Long getDepartmentId() {
return departmentId;
}
public void setDepartmentId(Long departmentId) {
this.departmentId = departmentId;
}
public String getDepartmentName() {
return departmentName;
}
public void setDepartmentName(String departmentName) {
this.departmentName = departmentName;
}
public String getCustomerName() {
return customerName;
}
public void setCustomerName(String customerName) {
this.customerName = customerName;
}
public String getCustomerPhone() {
return customerPhone;
}
public void setCustomerPhone(String customerPhone) {
this.customerPhone = customerPhone;
}
public String getRegisteredAddress() {
return registeredAddress;
}
public void setRegisteredAddress(String registeredAddress) {
this.registeredAddress = registeredAddress;
}
public String getBusinessLicense() {
return businessLicense;
}
public void setBusinessLicense(String businessLicense) {
this.businessLicense = businessLicense;
}
public String getUnifredCreditCode() {
return unifredCreditCode;
}
public void setUnifredCreditCode(String unifredCreditCode) {
this.unifredCreditCode = unifredCreditCode;
}
public String getBankCardNubmer() {
return bankCardNubmer;
}
public void setBankCardNubmer(String bankCardNubmer) {
this.bankCardNubmer = bankCardNubmer;
}
public String getBankAddress() {
return bankAddress;
}
public void setBankAddress(String bankAddress) {
this.bankAddress = bankAddress;
}
}
package com.jz.manage.moduls.controller.customer.bean.dto; package com.jz.manage.moduls.controller.customer.bean.dto;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
import java.util.Date; import java.util.Date;
...@@ -11,7 +12,7 @@ import java.util.Date; ...@@ -11,7 +12,7 @@ import java.util.Date;
* @Date: 2020/12/10 * @Date: 2020/12/10
* @Version: * @Version:
*/ */
@Api(tags = "企业审核信息返回参数") @ApiModel(value = "企业审核信息返回参数")
public class EnterpriseAuditDto { public class EnterpriseAuditDto {
@ApiModelProperty(value = "企业id") @ApiModelProperty(value = "企业id")
......
...@@ -2,7 +2,9 @@ package com.jz.manage.moduls.mapper; ...@@ -2,7 +2,9 @@ package com.jz.manage.moduls.mapper;
import com.jz.common.base.BaseMapper; import com.jz.common.base.BaseMapper;
import com.jz.common.entity.Department; import com.jz.common.entity.Department;
import com.jz.manage.moduls.controller.customer.bean.dto.CompanyDetailsDto;
import com.jz.manage.moduls.controller.customer.bean.dto.EnterpriseAuditDto; import com.jz.manage.moduls.controller.customer.bean.dto.EnterpriseAuditDto;
import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -21,4 +23,11 @@ public interface DepartmentDao extends BaseMapper<Department> { ...@@ -21,4 +23,11 @@ public interface DepartmentDao extends BaseMapper<Department> {
* @return * @return
*/ */
List<EnterpriseAuditDto> findList(Map<String, Object> param); List<EnterpriseAuditDto> findList(Map<String, Object> param);
/**
* 主键获取用户企业详情信息
* @param id
* @return
*/
CompanyDetailsDto selectById(@Param("departmentId") Long id);
} }
\ No newline at end of file
package com.jz.manage.moduls.service; package com.jz.manage.moduls.service;
import com.jz.common.bean.PageInfoResponse; import com.jz.common.bean.PageInfoResponse;
import com.jz.manage.moduls.controller.customer.bean.dto.CompanyDetailsDto;
import com.jz.manage.moduls.controller.customer.bean.dto.EnterpriseAuditDto; import com.jz.manage.moduls.controller.customer.bean.dto.EnterpriseAuditDto;
import com.jz.manage.moduls.controller.customer.bean.request.EnterpriseAuditRequest; import com.jz.manage.moduls.controller.customer.bean.request.EnterpriseAuditRequest;
...@@ -22,4 +23,11 @@ public interface DepartmentService { ...@@ -22,4 +23,11 @@ public interface DepartmentService {
* @return * @return
*/ */
PageInfoResponse<EnterpriseAuditDto> findList(EnterpriseAuditRequest auditRequest, HttpServletRequest req); PageInfoResponse<EnterpriseAuditDto> findList(EnterpriseAuditRequest auditRequest, HttpServletRequest req);
/**
* 主键获取用户企业详情信息
* @param id
* @return
*/
CompanyDetailsDto selectById(Long id);
} }
\ No newline at end of file
...@@ -4,6 +4,8 @@ import com.github.pagehelper.PageHelper; ...@@ -4,6 +4,8 @@ import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo; import com.github.pagehelper.PageInfo;
import com.jz.common.bean.PageInfoResponse; import com.jz.common.bean.PageInfoResponse;
import com.jz.common.constant.Constants; import com.jz.common.constant.Constants;
import com.jz.common.entity.Department;
import com.jz.manage.moduls.controller.customer.bean.dto.CompanyDetailsDto;
import com.jz.manage.moduls.controller.customer.bean.dto.EnterpriseAuditDto; import com.jz.manage.moduls.controller.customer.bean.dto.EnterpriseAuditDto;
import com.jz.manage.moduls.controller.customer.bean.request.EnterpriseAuditRequest; import com.jz.manage.moduls.controller.customer.bean.request.EnterpriseAuditRequest;
import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsDto; import com.jz.manage.moduls.controller.goods.bean.dto.DataGoodsDto;
...@@ -69,4 +71,16 @@ public class DepartmentServiceImpl implements DepartmentService { ...@@ -69,4 +71,16 @@ public class DepartmentServiceImpl implements DepartmentService {
pageInfoResponse.setData(pageInfo); pageInfoResponse.setData(pageInfo);
return pageInfoResponse; return pageInfoResponse;
} }
/**
* 主键获取用户企业详情信息
*
* @param id
* @return
*/
@Override
public CompanyDetailsDto selectById(Long id) {
CompanyDetailsDto CompanyDetails = tDepartmentDao.selectById(id);
return CompanyDetails;
}
} }
\ No newline at end of file
...@@ -311,4 +311,34 @@ ...@@ -311,4 +311,34 @@
and t1.audit_status = #{auditStatus} and t1.audit_status = #{auditStatus}
</if> </if>
</select> </select>
<select id="selectById" resultType="com.jz.manage.moduls.controller.customer.bean.dto.CompanyDetailsDto" parameterType="map">
SELECT
t1.department_id AS departmentId,
t1.department_name AS departmentName,
t1.registered_address AS registeredAddress,
t1.business_license AS businessLicense,
t1.unified_credit_code AS unifiedCreditCode,
t1.bank_address AS bankAddress,
t1.bank_card_number AS bankCardNumber,
(CASE
WHEN t1.audit_status = '01' THEN
'待审核'
WHEN t1.audit_status = '02' THEN
'已审核'
WHEN t1.audit_status = '03' THEN
'未通过'
END ) AS auditStatus,
t2.customer_name AS customerName,
t2.customer_phone AS customerPhone
FROM
t_department t1
INNER JOIN t_mall_customer t2 ON t1.department_id = t2.department_id
WHERE
1= 1 and
t1.del_flag = 'N'
<if test="departmentId != null">
and t1.department_id = #{departmentId}
</if>
</select>
</mapper> </mapper>
\ No newline at end of file
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