Commit b6f48fa5 authored by ysongq's avatar ysongq

企业审核添加

parent 7472fb81
...@@ -39,9 +39,9 @@ public class DataGoodsApiController extends BaseController { ...@@ -39,9 +39,9 @@ public class DataGoodsApiController extends BaseController {
*/ */
@GetMapping("/{id}") @GetMapping("/{id}")
@ApiOperation(value = "点击商品查看商品详情", notes = "api商品") @ApiOperation(value = "点击商品查看商品详情", notes = "api商品")
public Result<DataGoodsApiDto> findById(@PathVariable(value = "id") String id) { public Result<DataGoodsApiDto> findById(@PathVariable(value = "id") Long id) {
if (id != null) { if (id != null) {
DataGoodsApiDto dataGoodsApi = tDataGoodsApiService.selectById(Long.valueOf(id)); DataGoodsApiDto dataGoodsApi = tDataGoodsApiService.selectById(id);
return new Result<DataGoodsApiDto>(true, "查询商品详情成功!", StatusCode.OK, dataGoodsApi); return new Result<DataGoodsApiDto>(true, "查询商品详情成功!", StatusCode.OK, dataGoodsApi);
} }
return new Result<>(false, "查询商品详情失败!"); return new Result<>(false, "查询商品详情失败!");
......
...@@ -10,6 +10,7 @@ import com.jz.manage.moduls.controller.customer.bean.dto.EnterpriseAuditDto; ...@@ -10,6 +10,7 @@ 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.ApiModelProperty;
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.*; import org.springframework.web.bind.annotation.*;
...@@ -53,13 +54,29 @@ public class DepartmentController extends BaseController { ...@@ -53,13 +54,29 @@ public class DepartmentController extends BaseController {
return pageInfo; return pageInfo;
} }
/**
* 主键获取企业审核信息
* @param id
* @param req
* @return
*/
@GetMapping(value = "/{id}") @GetMapping(value = "/{id}")
@ApiOperation(value = "主键查询用户企业详情信息") @ApiOperation(value = "主键查询用户企业详情信息")
public Result<CompanyDetailsDto> selectById(@PathVariable(value = "id") String id, HttpServletRequest req) { public Result<CompanyDetailsDto> selectById(@PathVariable(value = "id") Long id, HttpServletRequest req) {
if (id != null) { if (id != null) {
CompanyDetailsDto companyDetails = departmentService.selectById(Long.valueOf(id)); CompanyDetailsDto companyDetails = departmentService.selectById(id);
return new Result<CompanyDetailsDto>(true, "查询企业详情成功!", StatusCode.OK, companyDetails); return new Result<CompanyDetailsDto>(true, "查询企业详情成功!", StatusCode.OK, companyDetails);
} }
return new Result<CompanyDetailsDto>(false, "查询企业详情失败!", StatusCode.ERROR); return new Result<CompanyDetailsDto>(false, "查询企业详情失败!", StatusCode.ERROR);
} }
}
\ No newline at end of file @PostMapping(value = "audit/{id}")
@ApiModelProperty(value = "企业审核")
public Result audit(@PathVariable(value = "id") Long id) {
if (id != null) {
departmentService.audit(id);
return new Result<CompanyDetailsDto>(true, "企业审核成功!", StatusCode.ERROR);
}
return new Result<CompanyDetailsDto>(false, "企业审核失败!", StatusCode.ERROR);
}
}
\ No newline at end of file
package com.jz.manage.moduls.entity; package com.jz.manage.moduls.entity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
...@@ -19,6 +22,7 @@ public class Department implements Serializable { ...@@ -19,6 +22,7 @@ public class Department implements Serializable {
/** /**
* 企业id * 企业id
*/ */
@TableId(value = "department_id",type = IdType.AUTO)
private Long departmentId; private Long departmentId;
/** /**
* 企业名称 * 企业名称
......
package com.jz.manage.moduls.mapper; 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.manage.moduls.entity.Department;
import com.jz.manage.moduls.controller.customer.bean.dto.CompanyDetailsDto; 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 org.apache.ibatis.annotations.Param;
......
...@@ -30,4 +30,10 @@ public interface DepartmentService { ...@@ -30,4 +30,10 @@ public interface DepartmentService {
* @return * @return
*/ */
CompanyDetailsDto selectById(Long id); CompanyDetailsDto selectById(Long id);
/**
* 企业审核信息
* @param id
*/
void audit(Long id);
} }
\ No newline at end of file
package com.jz.manage.moduls.service.impl; package com.jz.manage.moduls.service.impl;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.github.pagehelper.PageHelper; 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.common.constant.ResultCode;
import com.jz.common.exception.ResponseException;
import com.jz.common.utils.DateUtils;
import com.jz.manage.moduls.controller.customer.bean.dto.CompanyDetailsDto; 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.entity.Department;
import com.jz.manage.moduls.entity.FinanceCustomerAssets;
import com.jz.manage.moduls.mapper.DepartmentDao; import com.jz.manage.moduls.mapper.DepartmentDao;
import com.jz.manage.moduls.mapper.FinanceCustomerAssetsDao;
import com.jz.manage.moduls.service.DepartmentService; import com.jz.manage.moduls.service.DepartmentService;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -31,6 +38,8 @@ public class DepartmentServiceImpl implements DepartmentService { ...@@ -31,6 +38,8 @@ public class DepartmentServiceImpl implements DepartmentService {
@Autowired @Autowired
private DepartmentDao tDepartmentDao; private DepartmentDao tDepartmentDao;
@Autowired
private FinanceCustomerAssetsDao financeCustomerAssetsDao;
/** /**
* 条件查询企业审核信息列表 * 条件查询企业审核信息列表
* *
...@@ -74,7 +83,6 @@ public class DepartmentServiceImpl implements DepartmentService { ...@@ -74,7 +83,6 @@ public class DepartmentServiceImpl implements DepartmentService {
/** /**
* 主键获取用户企业详情信息 * 主键获取用户企业详情信息
*
* @param id * @param id
* @return * @return
*/ */
...@@ -83,4 +91,37 @@ public class DepartmentServiceImpl implements DepartmentService { ...@@ -83,4 +91,37 @@ public class DepartmentServiceImpl implements DepartmentService {
CompanyDetailsDto CompanyDetails = tDepartmentDao.selectById(id); CompanyDetailsDto CompanyDetails = tDepartmentDao.selectById(id);
return CompanyDetails; return CompanyDetails;
} }
/**
* 企业审核信息
*
* @param id
*/
@Override
public void audit(Long id) {
QueryWrapper queryWrapper = new QueryWrapper();
queryWrapper.eq("department_id", id);
// 获取企业详细信息
Department department = tDepartmentDao.selectOne(queryWrapper);
// if (department.getAuditStatus().equals("02") ) {
// throw ResponseException.of(ResultCode.FAILURE, "已审核!不用在审核!");
// }
// 从session获取商城用户id
// 更新信息: 将企业审核状态改为已审核,企业信息更新
department.setAuditStatus("02");
department.setAuditPerson("1");
department.setAuditTime(DateUtils.getToday());
department.setUptTime(DateUtils.getToday());
department.setUptPerson(department.getUptPerson());
tDepartmentDao.updateById(department);
// 新增企业客户资产
FinanceCustomerAssets financeCustomerAssets = new FinanceCustomerAssets();
financeCustomerAssets.setDepartmentId(department.getDepartmentId());
financeCustomerAssets.setCreTime(DateUtils.getToday());
financeCustomerAssets.setCrePerson("1");
financeCustomerAssetsDao.insert(financeCustomerAssets);
}
} }
\ 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