20 changed files with 548 additions and 7 deletions
@ -0,0 +1,25 @@ |
|||
package com.yxt.yythmall.api.approvalrecords; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.UUID; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class ApprovalRecords { |
|||
|
|||
private String id; |
|||
private String sid= UUID.randomUUID().toString(); |
|||
private String createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String customerSid; |
|||
private String approvalOpinions;//审核意见
|
|||
private String operator;//操作人
|
|||
private String operatorSid;//操作人sid
|
|||
private String approvalStatus;//审核状态
|
|||
|
|||
} |
@ -0,0 +1,22 @@ |
|||
package com.yxt.yythmall.api.approvalrecords; |
|||
|
|||
import com.yxt.common.core.dto.Dto; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class ApprovalRecordsDto implements Dto { |
|||
private String id; |
|||
private String sid; |
|||
private String createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String customerSid; |
|||
private String approvalOpinions;//审核意见
|
|||
private String operator;//操作人
|
|||
private String operatorSid;//操作人sid
|
|||
private String approvalStatus;//审核状态
|
|||
} |
@ -0,0 +1,15 @@ |
|||
package com.yxt.yythmall.api.approvalrecords; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class ApprovalRecordsQuery implements Query { |
|||
private String shortName; |
|||
private String name; |
|||
private String reviewStatus; |
|||
} |
@ -0,0 +1,23 @@ |
|||
package com.yxt.yythmall.api.approvalrecords; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class ApprovalRecordsVo implements Vo { |
|||
private String id; |
|||
private String sid; |
|||
private String createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String customerSid; |
|||
private String approvalOpinions;//审核意见
|
|||
private String operator;//操作人
|
|||
private String operatorSid;//操作人sid
|
|||
private String approvalStatus;//审核状态
|
|||
private String customerName; |
|||
} |
@ -0,0 +1,27 @@ |
|||
package com.yxt.yythmall.api.enterprisecertification; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.util.UUID; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class EnterpriseCertification { |
|||
|
|||
private String id; |
|||
private String sid= UUID.randomUUID().toString(); |
|||
private String createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String customerSid; |
|||
private String enterpriseName; |
|||
private String shippingAddress; |
|||
private String contacts; |
|||
private String telephone; |
|||
private String reviewStatus; |
|||
private String state; |
|||
|
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.yxt.yythmall.api.enterprisecertification; |
|||
|
|||
import com.yxt.common.core.dto.Dto; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class EnterpriseCertificationDto implements Dto { |
|||
private String id; |
|||
private String sid; |
|||
private String createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String customerSid; |
|||
private String enterpriseName;//企业名称
|
|||
private String shippingAddress;//地址
|
|||
private String contacts;//联系人
|
|||
private String telephone;//联系电话
|
|||
private String reviewStatus; |
|||
private String state; |
|||
private String operator; |
|||
} |
@ -0,0 +1,15 @@ |
|||
package com.yxt.yythmall.api.enterprisecertification; |
|||
|
|||
import com.yxt.common.core.query.Query; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class EnterpriseCertificationQuery implements Query { |
|||
private String shortName; |
|||
private String name; |
|||
private String reviewStatus; |
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.yxt.yythmall.api.enterprisecertification; |
|||
|
|||
import com.yxt.common.core.vo.Vo; |
|||
import lombok.Data; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/30 9:27 |
|||
*/ |
|||
@Data |
|||
public class EnterpriseCertificationVo implements Vo { |
|||
private String id; |
|||
private String sid; |
|||
private String createTime; |
|||
private String remarks; |
|||
private String isEnable; |
|||
private String customerSid; |
|||
private String enterpriseName; |
|||
private String shippingAddress; |
|||
private String contacts; |
|||
private String telephone; |
|||
private String reviewStatus; |
|||
private String state; |
|||
private String customerName; |
|||
} |
@ -0,0 +1,23 @@ |
|||
package com.yxt.yythmall.biz.approvalrecords; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
|
|||
import com.yxt.yythmall.api.approvalrecords.ApprovalRecords; |
|||
import com.yxt.yythmall.api.approvalrecords.ApprovalRecordsVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/21 15:03 |
|||
*/ |
|||
@Mapper |
|||
public interface ApprovalRecordsMapper extends BaseMapper<ApprovalRecords> { |
|||
|
|||
IPage<ApprovalRecordsVo> ListPageVo(IPage<ApprovalRecords> page, @Param(Constants.WRAPPER) QueryWrapper<ApprovalRecords> qw); |
|||
|
|||
|
|||
} |
@ -0,0 +1,17 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.yxt.yythmall.biz.approvalrecords.ApprovalRecordsMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
|
|||
|
|||
<select id="ListPageVo" resultType="com.yxt.yythmall.api.approvalrecords.ApprovalRecordsVo"> |
|||
select |
|||
a.*,b.nick as customerName |
|||
from approval_records a |
|||
left join lpk_customer b on b.sid=a.customerSid |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,47 @@ |
|||
package com.yxt.yythmall.biz.approvalrecords; |
|||
|
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.yythmall.api.approvalrecords.ApprovalRecordsDto; |
|||
import com.yxt.yythmall.api.approvalrecords.ApprovalRecordsQuery; |
|||
import com.yxt.yythmall.api.approvalrecords.ApprovalRecordsVo; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.PostMapping; |
|||
import org.springframework.web.bind.annotation.RequestBody; |
|||
import org.springframework.web.bind.annotation.RequestMapping; |
|||
import org.springframework.web.bind.annotation.RestController; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/21 15:03 |
|||
*/ |
|||
|
|||
@Api(tags = "企业认证") |
|||
@RestController |
|||
@RequestMapping("ApprovalRecords") |
|||
public class ApprovalRecordsRest { |
|||
|
|||
@Autowired |
|||
ApprovalRecordsService approvalRecordsService; |
|||
|
|||
@ApiOperation("分页列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<ApprovalRecordsVo>> ListPageVo(@RequestBody PagerQuery<ApprovalRecordsQuery> pq) { |
|||
return approvalRecordsService.ListPageVo(pq); |
|||
} |
|||
@ApiOperation("保存") |
|||
@PostMapping("/save") |
|||
public ResultBean save(@RequestBody ApprovalRecordsDto dto) { |
|||
return approvalRecordsService.save(dto); |
|||
} |
|||
// @ApiOperation("修改")
|
|||
// @PostMapping("/update")
|
|||
// public ResultBean update(@RequestBody ApprovalRecordsDto dto) {
|
|||
// return approvalRecordsService.update(dto);
|
|||
// }
|
|||
|
|||
|
|||
} |
@ -0,0 +1,53 @@ |
|||
package com.yxt.yythmall.biz.approvalrecords; |
|||
|
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.base.utils.PagerUtil; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.yythmall.api.approvalrecords.ApprovalRecords; |
|||
import com.yxt.yythmall.api.approvalrecords.ApprovalRecordsDto; |
|||
import com.yxt.yythmall.api.approvalrecords.ApprovalRecordsQuery; |
|||
import com.yxt.yythmall.api.approvalrecords.ApprovalRecordsVo; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/21 15:03 |
|||
*/ |
|||
@Service |
|||
public class ApprovalRecordsService extends MybatisBaseService<ApprovalRecordsMapper, ApprovalRecords> { |
|||
|
|||
|
|||
public ResultBean<PagerVo<ApprovalRecordsVo>> ListPageVo(PagerQuery<ApprovalRecordsQuery> pq) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
ApprovalRecordsQuery query = pq.getParams(); |
|||
QueryWrapper<ApprovalRecords> qw = new QueryWrapper<>(); |
|||
qw.eq("reviewStatus","0"); |
|||
qw.orderByDesc("createTime"); |
|||
IPage<ApprovalRecords> page = PagerUtil.queryToPage(pq); |
|||
IPage<ApprovalRecordsVo> pagging = baseMapper.ListPageVo(page, qw); |
|||
PagerVo<ApprovalRecordsVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return rb.success().setData(p); |
|||
} |
|||
|
|||
public ResultBean save(ApprovalRecordsDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
baseMapper.delete(new QueryWrapper<ApprovalRecords>().eq("customerSid",dto.getCustomerSid())); |
|||
ApprovalRecords entity=new ApprovalRecords(); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.insert(entity); |
|||
return rb.success().setMsg("添加成功"); |
|||
} |
|||
// public ResultBean update(ApprovalRecordsDto dto) {
|
|||
// ResultBean rb=new ResultBean();
|
|||
// ApprovalRecords entity=baseMapper.selectOne(new QueryWrapper<ApprovalRecords>().eq("customerSid",dto.getCustomerSid()));
|
|||
// BeanUtil.copyProperties(dto, entity, "id", "sid");
|
|||
// entity.setReviewStatus("0");
|
|||
// baseMapper.updateById(entity);
|
|||
// return rb.success().setMsg("修改成功");
|
|||
// }
|
|||
} |
@ -0,0 +1,25 @@ |
|||
package com.yxt.yythmall.biz.enterprisecertification; |
|||
|
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.baomidou.mybatisplus.core.toolkit.Constants; |
|||
import com.yxt.yythmall.api.enterprisecertification.EnterpriseCertification; |
|||
import com.yxt.yythmall.api.enterprisecertification.EnterpriseCertificationVo; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
import org.apache.ibatis.annotations.Param; |
|||
import org.apache.ibatis.annotations.Select; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/21 15:03 |
|||
*/ |
|||
@Mapper |
|||
public interface EnterpriseCertificationMapper extends BaseMapper<EnterpriseCertification> { |
|||
|
|||
IPage<EnterpriseCertificationVo> ListPageVo(IPage<EnterpriseCertification> page, @Param(Constants.WRAPPER) QueryWrapper<EnterpriseCertification> qw); |
|||
|
|||
|
|||
} |
@ -0,0 +1,17 @@ |
|||
<?xml version="1.0" encoding="UTF-8" ?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
<mapper namespace="com.yxt.yythmall.biz.enterprisecertification.EnterpriseCertificationMapper"> |
|||
<!-- <where> ${ew.sqlSegment} </where>--> |
|||
<!-- ${ew.customSqlSegment} --> |
|||
|
|||
|
|||
<select id="ListPageVo" resultType="com.yxt.yythmall.api.enterprisecertification.EnterpriseCertificationVo"> |
|||
select |
|||
a.*,b.nick as customerName |
|||
from enterprise_certification a |
|||
left join lpk_customer b on a.customerSid= b.sid |
|||
<where> |
|||
${ew.sqlSegment} |
|||
</where> |
|||
</select> |
|||
</mapper> |
@ -0,0 +1,48 @@ |
|||
package com.yxt.yythmall.biz.enterprisecertification; |
|||
|
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.yythmall.api.enterprisecertification.EnterpriseCertificationDto; |
|||
import com.yxt.yythmall.api.enterprisecertification.EnterpriseCertificationQuery; |
|||
import com.yxt.yythmall.api.enterprisecertification.EnterpriseCertificationVo; |
|||
import io.swagger.annotations.Api; |
|||
import io.swagger.annotations.ApiOperation; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.web.bind.annotation.*; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/21 15:03 |
|||
*/ |
|||
|
|||
@Api(tags = "企业认证") |
|||
@RestController |
|||
@RequestMapping("enterprisecertification") |
|||
public class EnterpriseCertificationRest { |
|||
|
|||
@Autowired |
|||
EnterpriseCertificationService EnterpriseCertificationService; |
|||
|
|||
@ApiOperation("分页列表") |
|||
@PostMapping("/listPage") |
|||
public ResultBean<PagerVo<EnterpriseCertificationVo>> ListPageVo(@RequestBody PagerQuery<EnterpriseCertificationQuery> pq) { |
|||
return EnterpriseCertificationService.ListPageVo(pq); |
|||
} |
|||
@ApiOperation("保存") |
|||
@PostMapping("/save") |
|||
public ResultBean save(@RequestBody EnterpriseCertificationDto dto) { |
|||
return EnterpriseCertificationService.save(dto); |
|||
} |
|||
@ApiOperation("修改") |
|||
@PostMapping("/update") |
|||
public ResultBean update(@RequestBody EnterpriseCertificationDto dto) { |
|||
return EnterpriseCertificationService.update(dto); |
|||
} |
|||
|
|||
@ApiOperation("审核") |
|||
@PostMapping("/toExamine") |
|||
public ResultBean toExamine(@RequestBody EnterpriseCertificationDto dto) { |
|||
return EnterpriseCertificationService.toExamine(dto); |
|||
} |
|||
} |
@ -0,0 +1,94 @@ |
|||
package com.yxt.yythmall.biz.enterprisecertification; |
|||
|
|||
import cn.dev33.satoken.stp.StpUtil; |
|||
import cn.hutool.core.bean.BeanUtil; |
|||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|||
import com.baomidou.mybatisplus.core.metadata.IPage; |
|||
import com.yxt.common.base.service.MybatisBaseService; |
|||
import com.yxt.common.base.utils.PagerUtil; |
|||
import com.yxt.common.base.utils.StringUtils; |
|||
import com.yxt.common.core.query.PagerQuery; |
|||
import com.yxt.common.core.result.ResultBean; |
|||
import com.yxt.common.core.vo.PagerVo; |
|||
import com.yxt.yythmall.api.approvalrecords.ApprovalRecordsDto; |
|||
import com.yxt.yythmall.api.enterprisecertification.EnterpriseCertification; |
|||
import com.yxt.yythmall.api.enterprisecertification.EnterpriseCertificationDto; |
|||
import com.yxt.yythmall.api.enterprisecertification.EnterpriseCertificationQuery; |
|||
import com.yxt.yythmall.api.enterprisecertification.EnterpriseCertificationVo; |
|||
import com.yxt.yythmall.api.lpkcustomer.LpkCustomer; |
|||
import com.yxt.yythmall.api.sysuser.SysUser; |
|||
import com.yxt.yythmall.biz.approvalrecords.ApprovalRecordsService; |
|||
import com.yxt.yythmall.biz.lpkcustomer.LpkCustomerService; |
|||
import com.yxt.yythmall.biz.sysuser.SysUserService; |
|||
import org.springframework.beans.factory.annotation.Autowired; |
|||
import org.springframework.stereotype.Service; |
|||
|
|||
import java.util.List; |
|||
|
|||
/** |
|||
* @author wangpengfei |
|||
* @date 2023/11/21 15:03 |
|||
*/ |
|||
@Service |
|||
public class EnterpriseCertificationService extends MybatisBaseService<EnterpriseCertificationMapper, EnterpriseCertification> { |
|||
@Autowired |
|||
ApprovalRecordsService approvalRecordsService; |
|||
@Autowired |
|||
SysUserService sysUserService; |
|||
|
|||
public ResultBean<PagerVo<EnterpriseCertificationVo>> ListPageVo(PagerQuery<EnterpriseCertificationQuery> pq) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
EnterpriseCertificationQuery query = pq.getParams(); |
|||
QueryWrapper<EnterpriseCertification> qw = new QueryWrapper<>(); |
|||
qw.eq("reviewStatus","0"); |
|||
qw.orderByDesc("createTime"); |
|||
if(StringUtils.isNotBlank(query.getName())){ |
|||
qw.like("enterpriseName",query.getName()); |
|||
} |
|||
IPage<EnterpriseCertification> page = PagerUtil.queryToPage(pq); |
|||
IPage<EnterpriseCertificationVo> pagging = baseMapper.ListPageVo(page, qw); |
|||
PagerVo<EnterpriseCertificationVo> p = PagerUtil.pageToVo(pagging, null); |
|||
return rb.success().setData(p); |
|||
} |
|||
|
|||
public ResultBean save(EnterpriseCertificationDto dto) { |
|||
ResultBean rb = ResultBean.fireFail(); |
|||
baseMapper.delete(new QueryWrapper<EnterpriseCertification>().eq("customerSid",dto.getCustomerSid())); |
|||
EnterpriseCertification entity=new EnterpriseCertification(); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
baseMapper.insert(entity); |
|||
return rb.success().setMsg("添加成功"); |
|||
} |
|||
public ResultBean update(EnterpriseCertificationDto dto) { |
|||
ResultBean rb=new ResultBean(); |
|||
EnterpriseCertification entity=baseMapper.selectOne(new QueryWrapper<EnterpriseCertification>().eq("customerSid",dto.getCustomerSid())); |
|||
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|||
entity.setReviewStatus("0"); |
|||
baseMapper.updateById(entity); |
|||
return rb.success().setMsg("修改成功"); |
|||
} |
|||
public ResultBean toExamine(EnterpriseCertificationDto dto) { |
|||
ResultBean rb=new ResultBean(); |
|||
if(StringUtils.isBlank(dto.getSid())){ |
|||
return rb.setMsg("参数不全"); |
|||
} |
|||
EnterpriseCertification entity=baseMapper.selectOne(new QueryWrapper<EnterpriseCertification>().eq("sid",dto.getSid())); |
|||
entity.setReviewStatus(dto.getReviewStatus()); |
|||
if(StringUtils.isNotBlank(dto.getRemarks())){ |
|||
entity.setRemarks(dto.getRemarks()); |
|||
} |
|||
baseMapper.updateById(entity); |
|||
//审核记录
|
|||
ApprovalRecordsDto dto1=new ApprovalRecordsDto(); |
|||
dto1.setApprovalOpinions(dto.getRemarks()); |
|||
dto1.setCustomerSid(entity.getCustomerSid()); |
|||
Object id=StpUtil.getLoginIdByToken(StpUtil.getTokenValue()); |
|||
SysUser sysUser=sysUserService.getOne(new QueryWrapper<SysUser>().eq("id",id)); |
|||
dto1.setOperator(sysUser.getUserName()); |
|||
dto1.setOperatorSid(sysUser.getSid()); |
|||
dto1.setApprovalStatus(dto.getReviewStatus()); |
|||
approvalRecordsService.save(dto1); |
|||
return rb.success().setMsg("审核成功"); |
|||
} |
|||
|
|||
} |
Loading…
Reference in new issue