23 changed files with 596 additions and 9 deletions
@ -0,0 +1,25 @@ |
|||||
|
package com.yxt.supervise.crm.api.bankmanager; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.yxt.common.core.domain.BaseEntity; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/12 9:40 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "银行联系人信息", description = "银行联系人信息") |
||||
|
@TableName("bank_manager") |
||||
|
public class BankManager extends BaseEntity { |
||||
|
@ApiModelProperty("联系人") |
||||
|
private String name; |
||||
|
@ApiModelProperty("电话") |
||||
|
private String telephone; |
||||
|
@ApiModelProperty("职务") |
||||
|
private String post; |
||||
|
@ApiModelProperty("银行sid") |
||||
|
private String bankSid; |
||||
|
} |
@ -0,0 +1,14 @@ |
|||||
|
package com.yxt.supervise.crm.api.bankmanager; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/12 9:40 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "银行联系人信息 视图数据详情", description = "银行联系人信息 视图数据详情") |
||||
|
public class BankManagerDetailsVo implements Vo { |
||||
|
} |
@ -0,0 +1,14 @@ |
|||||
|
package com.yxt.supervise.crm.api.bankmanager; |
||||
|
|
||||
|
import com.yxt.common.core.dto.Dto; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/12 9:41 |
||||
|
*/ |
||||
|
@ApiModel(value = "银行联系人信息 数据传输对象", description = "银行联系人信息 数据传输对象") |
||||
|
@Data |
||||
|
public class BankManagerDto implements Dto { |
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
package com.yxt.supervise.crm.api.bankmanager; |
||||
|
|
||||
|
import com.yxt.supervise.crm.api.loanbankinformation.LoanBankInformationFeignFallback; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/12 9:41 |
||||
|
*/ |
||||
|
@Api(tags = "银行联系人信息") |
||||
|
@FeignClient( |
||||
|
contextId = "supervise-crm-BankManager", |
||||
|
name = "supervise-crm", |
||||
|
path = "v1/bankmanager", |
||||
|
fallback = LoanBankInformationFeignFallback.class) |
||||
|
public interface BankManagerFeign { |
||||
|
} |
@ -0,0 +1,11 @@ |
|||||
|
package com.yxt.supervise.crm.api.bankmanager; |
||||
|
|
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/12 9:41 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class BankManagerFeignFallback implements BankManagerFeign{ |
||||
|
} |
@ -0,0 +1,14 @@ |
|||||
|
package com.yxt.supervise.crm.api.bankmanager; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/12 9:41 |
||||
|
*/ |
||||
|
@ApiModel(value = "银行联系人信息 查询条件", description = "银行联系人信息 查询条件") |
||||
|
@Data |
||||
|
public class BankManagerQuery implements Query { |
||||
|
} |
@ -0,0 +1,25 @@ |
|||||
|
package com.yxt.supervise.crm.api.bankmanager; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/12 9:41 |
||||
|
*/ |
||||
|
@ApiModel(value = "银行联系人信息 视图数据对象", description = "银行联系人信息 视图数据对象") |
||||
|
@Data |
||||
|
public class BankManagerVo implements Vo { |
||||
|
private String id; |
||||
|
private String sid; |
||||
|
@ApiModelProperty("联系人") |
||||
|
private String name; |
||||
|
@ApiModelProperty("电话") |
||||
|
private String telephone; |
||||
|
@ApiModelProperty("职务") |
||||
|
private String post; |
||||
|
@ApiModelProperty("银行sid") |
||||
|
private String bankSid; |
||||
|
} |
@ -0,0 +1,44 @@ |
|||||
|
package com.yxt.supervise.crm.api.enterpriseinformation; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.annotation.TableName; |
||||
|
import com.yxt.common.core.domain.BaseEntity; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/12 11:43 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "企业信息", description = "企业信息") |
||||
|
@TableName("enterprise_information") |
||||
|
public class EnterpriseInformation extends BaseEntity { |
||||
|
@ApiModelProperty("企业名称") |
||||
|
private String enterpriseName; |
||||
|
@ApiModelProperty("企业简称") |
||||
|
private String enterpriseAbbreviation; |
||||
|
@ApiModelProperty("银行账户") |
||||
|
private String bankAccount; |
||||
|
@ApiModelProperty("账号") |
||||
|
private String accountNumber; |
||||
|
@ApiModelProperty("开户行") |
||||
|
private String openingBankName; |
||||
|
@ApiModelProperty("法人") |
||||
|
private String juridicalPerson; |
||||
|
@ApiModelProperty("营业执照号") |
||||
|
private String businessLicenseNumber; |
||||
|
@ApiModelProperty("地址") |
||||
|
private String address; |
||||
|
@ApiModelProperty("省") |
||||
|
private String province; |
||||
|
@ApiModelProperty("市") |
||||
|
private String city; |
||||
|
@ApiModelProperty("区") |
||||
|
private String county; |
||||
|
@ApiModelProperty("联系人") |
||||
|
private String contacts; |
||||
|
@ApiModelProperty("电话") |
||||
|
private String telephone; |
||||
|
|
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
package com.yxt.supervise.crm.api.enterpriseinformation; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/12 11:43 |
||||
|
*/ |
||||
|
@Data |
||||
|
@ApiModel(value = "企业信息 视图数据详情", description = "企业信息 视图数据详情") |
||||
|
public class EnterpriseInformationDetailsVo implements Vo { |
||||
|
private String id; |
||||
|
private String sid; |
||||
|
@ApiModelProperty("企业名称") |
||||
|
private String enterpriseName; |
||||
|
@ApiModelProperty("企业简称") |
||||
|
private String enterpriseAbbreviation; |
||||
|
@ApiModelProperty("银行账户") |
||||
|
private String bankAccount; |
||||
|
@ApiModelProperty("账号") |
||||
|
private String accountNumber; |
||||
|
@ApiModelProperty("开户行") |
||||
|
private String openingBankName; |
||||
|
@ApiModelProperty("法人") |
||||
|
private String juridicalPerson; |
||||
|
@ApiModelProperty("营业执照号") |
||||
|
private String businessLicenseNumber; |
||||
|
@ApiModelProperty("地址") |
||||
|
private String address; |
||||
|
@ApiModelProperty("省") |
||||
|
private String province; |
||||
|
@ApiModelProperty("市") |
||||
|
private String city; |
||||
|
@ApiModelProperty("区") |
||||
|
private String county; |
||||
|
@ApiModelProperty("联系人") |
||||
|
private String contacts; |
||||
|
@ApiModelProperty("电话") |
||||
|
private String telephone; |
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
package com.yxt.supervise.crm.api.enterpriseinformation; |
||||
|
|
||||
|
import com.yxt.common.core.dto.Dto; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/12 11:43 |
||||
|
*/ |
||||
|
@ApiModel(value = "企业信息 数据传输对象", description = "企业信息 数据传输对象") |
||||
|
@Data |
||||
|
public class EnterpriseInformationDto implements Dto { |
||||
|
private String id; |
||||
|
private String sid; |
||||
|
@ApiModelProperty("企业名称") |
||||
|
private String enterpriseName; |
||||
|
@ApiModelProperty("企业简称") |
||||
|
private String enterpriseAbbreviation; |
||||
|
@ApiModelProperty("银行账户") |
||||
|
private String bankAccount; |
||||
|
@ApiModelProperty("账号") |
||||
|
private String accountNumber; |
||||
|
@ApiModelProperty("开户行") |
||||
|
private String openingBankName; |
||||
|
@ApiModelProperty("法人") |
||||
|
private String juridicalPerson; |
||||
|
@ApiModelProperty("营业执照号") |
||||
|
private String businessLicenseNumber; |
||||
|
@ApiModelProperty("地址") |
||||
|
private String address; |
||||
|
@ApiModelProperty("省") |
||||
|
private String province; |
||||
|
@ApiModelProperty("市") |
||||
|
private String city; |
||||
|
@ApiModelProperty("区") |
||||
|
private String county; |
||||
|
@ApiModelProperty("联系人") |
||||
|
private String contacts; |
||||
|
@ApiModelProperty("电话") |
||||
|
private String telephone; |
||||
|
} |
@ -0,0 +1,18 @@ |
|||||
|
package com.yxt.supervise.crm.api.enterpriseinformation; |
||||
|
|
||||
|
import com.yxt.supervise.crm.api.loanbankinformation.LoanBankInformationFeignFallback; |
||||
|
import io.swagger.annotations.Api; |
||||
|
import org.springframework.cloud.openfeign.FeignClient; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/12 11:44 |
||||
|
*/ |
||||
|
@Api(tags = "企业信息") |
||||
|
@FeignClient( |
||||
|
contextId = "supervise-crm-EnterpriseInformation", |
||||
|
name = "supervise-crm", |
||||
|
path = "v1/enterpriseinformation", |
||||
|
fallback = EnterpriseInformationFeignFallback.class) |
||||
|
public interface EnterpriseInformationFeign { |
||||
|
} |
@ -0,0 +1,11 @@ |
|||||
|
package com.yxt.supervise.crm.api.enterpriseinformation; |
||||
|
|
||||
|
import org.springframework.stereotype.Component; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/12 11:44 |
||||
|
*/ |
||||
|
@Component |
||||
|
public class EnterpriseInformationFeignFallback implements EnterpriseInformationFeign{ |
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
package com.yxt.supervise.crm.api.enterpriseinformation; |
||||
|
|
||||
|
import com.yxt.common.core.query.Query; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/12 11:44 |
||||
|
*/ |
||||
|
@ApiModel(value = "企业信息 查询条件", description = "企业信息 查询条件") |
||||
|
@Data |
||||
|
public class EnterpriseInformationQuery implements Query { |
||||
|
private String id; |
||||
|
private String sid; |
||||
|
@ApiModelProperty("企业名称") |
||||
|
private String enterpriseName; |
||||
|
@ApiModelProperty("企业简称") |
||||
|
private String enterpriseAbbreviation; |
||||
|
@ApiModelProperty("银行账户") |
||||
|
private String bankAccount; |
||||
|
@ApiModelProperty("账号") |
||||
|
private String accountNumber; |
||||
|
@ApiModelProperty("开户行") |
||||
|
private String openingBankName; |
||||
|
@ApiModelProperty("法人") |
||||
|
private String juridicalPerson; |
||||
|
@ApiModelProperty("营业执照号") |
||||
|
private String businessLicenseNumber; |
||||
|
@ApiModelProperty("地址") |
||||
|
private String address; |
||||
|
@ApiModelProperty("省") |
||||
|
private String province; |
||||
|
@ApiModelProperty("市") |
||||
|
private String city; |
||||
|
@ApiModelProperty("区") |
||||
|
private String county; |
||||
|
@ApiModelProperty("联系人") |
||||
|
private String contacts; |
||||
|
@ApiModelProperty("电话") |
||||
|
private String telephone; |
||||
|
} |
@ -0,0 +1,43 @@ |
|||||
|
package com.yxt.supervise.crm.api.enterpriseinformation; |
||||
|
|
||||
|
import com.yxt.common.core.vo.Vo; |
||||
|
import io.swagger.annotations.ApiModel; |
||||
|
import io.swagger.annotations.ApiModelProperty; |
||||
|
import lombok.Data; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/12 11:44 |
||||
|
*/ |
||||
|
@ApiModel(value = "企业信息 视图数据对象", description = "企业信息 视图数据对象") |
||||
|
@Data |
||||
|
public class EnterpriseInformationVo implements Vo { |
||||
|
private String id; |
||||
|
private String sid; |
||||
|
@ApiModelProperty("企业名称") |
||||
|
private String enterpriseName; |
||||
|
@ApiModelProperty("企业简称") |
||||
|
private String enterpriseAbbreviation; |
||||
|
@ApiModelProperty("银行账户") |
||||
|
private String bankAccount; |
||||
|
@ApiModelProperty("账号") |
||||
|
private String accountNumber; |
||||
|
@ApiModelProperty("开户行") |
||||
|
private String openingBankName; |
||||
|
@ApiModelProperty("法人") |
||||
|
private String juridicalPerson; |
||||
|
@ApiModelProperty("营业执照号") |
||||
|
private String businessLicenseNumber; |
||||
|
@ApiModelProperty("地址") |
||||
|
private String address; |
||||
|
@ApiModelProperty("省") |
||||
|
private String province; |
||||
|
@ApiModelProperty("市") |
||||
|
private String city; |
||||
|
@ApiModelProperty("区") |
||||
|
private String county; |
||||
|
@ApiModelProperty("联系人") |
||||
|
private String contacts; |
||||
|
@ApiModelProperty("电话") |
||||
|
private String telephone; |
||||
|
} |
@ -0,0 +1,28 @@ |
|||||
|
package com.yxt.supervise.crm.biz.enterpriseinformation; |
||||
|
|
||||
|
import com.baomidou.mybatisplus.core.conditions.Wrapper; |
||||
|
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
||||
|
import com.baomidou.mybatisplus.core.toolkit.Constants; |
||||
|
import com.yxt.supervise.crm.api.bankmanager.BankManagerVo; |
||||
|
import com.yxt.supervise.crm.api.enterpriseinformation.EnterpriseInformation; |
||||
|
import com.yxt.supervise.crm.api.enterpriseinformation.EnterpriseInformation; |
||||
|
import com.yxt.supervise.crm.api.enterpriseinformation.EnterpriseInformationVo; |
||||
|
import org.apache.ibatis.annotations.Mapper; |
||||
|
import org.apache.ibatis.annotations.Param; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/12 11:49 |
||||
|
*/ |
||||
|
@Mapper |
||||
|
public interface EnterpriseInformationMapper extends BaseMapper<EnterpriseInformation> { |
||||
|
IPage<EnterpriseInformationVo> selectPageVo(IPage<EnterpriseInformation> page, @Param(Constants.WRAPPER) Wrapper<EnterpriseInformation> qw); |
||||
|
EnterpriseInformationVo getEnterpriseBySid( @Param("sid") String sid); |
||||
|
//查询联系人
|
||||
|
List<BankManagerVo> getBankManager(@Param("sid") String sid); |
||||
|
//根据sid下级
|
||||
|
List<EnterpriseInformationVo> bankList(@Param("sid") String sid); |
||||
|
} |
@ -0,0 +1,29 @@ |
|||||
|
<?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.supervise.crm.biz.enterpriseinformation.EnterpriseInformationMapper"> |
||||
|
<!-- <where> ${ew.sqlSegment} </where>--> |
||||
|
<!-- ${ew.customSqlSegment} --> |
||||
|
<select id="selectPageVo" resultType="com.yxt.supervise.crm.api.enterpriseinformation.EnterpriseInformationVo"> |
||||
|
SELECT * |
||||
|
FROM enterprise_information |
||||
|
<where> |
||||
|
${ew.sqlSegment} |
||||
|
</where> |
||||
|
</select> |
||||
|
<!--根据客户的微信号以及当前登录者所在部门的sid和登录者所关联的员工sid查询--> |
||||
|
<select id="getEnterpriseBySid" resultType="com.yxt.supervise.crm.api.enterpriseinformation.EnterpriseInformationVo"> |
||||
|
SELECT * |
||||
|
FROM enterprise_information |
||||
|
WHERE sid=#{sid} |
||||
|
</select> |
||||
|
<select id="getBankManager" resultType="com.yxt.supervise.crm.api.bankmanager.BankManagerVo"> |
||||
|
SELECT * |
||||
|
FROM bank_manager |
||||
|
WHERE bankSid=#{sid} |
||||
|
</select> |
||||
|
<select id="bankList" resultType="com.yxt.supervise.crm.api.loanbankinformation.LoanBankInformationVo"> |
||||
|
SELECT * |
||||
|
FROM loan_bank_information |
||||
|
WHERE psid=#{sid} |
||||
|
</select> |
||||
|
</mapper> |
@ -0,0 +1,56 @@ |
|||||
|
package com.yxt.supervise.crm.biz.enterpriseinformation; |
||||
|
|
||||
|
import com.yxt.common.core.query.PagerQuery; |
||||
|
import com.yxt.common.core.result.ResultBean; |
||||
|
import com.yxt.common.core.vo.PagerVo; |
||||
|
import com.yxt.supervise.crm.api.enterpriseinformation.EnterpriseInformationDto; |
||||
|
import com.yxt.supervise.crm.api.enterpriseinformation.EnterpriseInformationQuery; |
||||
|
import com.yxt.supervise.crm.api.enterpriseinformation.EnterpriseInformationVo; |
||||
|
import com.yxt.supervise.crm.biz.enterpriseinformation.EnterpriseInformationService; |
||||
|
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/4/12 11:49 |
||||
|
*/ |
||||
|
@Api(tags = "企业信息") |
||||
|
@RestController |
||||
|
@RequestMapping("v1/enterpriseinformation") |
||||
|
public class EnterpriseInformationRest { |
||||
|
@Autowired |
||||
|
EnterpriseInformationService EnterpriseInformationService; |
||||
|
|
||||
|
//@Override
|
||||
|
@ApiOperation("根据条件分页查询数据的列表") |
||||
|
@PostMapping("/listPage") |
||||
|
public ResultBean<PagerVo<EnterpriseInformationVo>> listPage(@RequestBody PagerQuery<EnterpriseInformationQuery> pq) { |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
PagerVo<EnterpriseInformationVo> pv = EnterpriseInformationService.listPageVo(pq); |
||||
|
return rb.success().setData(pv); |
||||
|
} |
||||
|
@ApiOperation("根据条件分页查询数据的列表") |
||||
|
@PostMapping("/save") |
||||
|
public ResultBean save(@RequestBody EnterpriseInformationDto dto) { |
||||
|
return EnterpriseInformationService.save(dto); |
||||
|
} |
||||
|
@ApiOperation("根据条件分页查询数据的列表") |
||||
|
@PostMapping("/update") |
||||
|
public ResultBean update(@RequestBody EnterpriseInformationDto dto) { |
||||
|
return EnterpriseInformationService.update(dto); |
||||
|
} |
||||
|
@ApiOperation("根据sid查询数据的") |
||||
|
@GetMapping("/getEnterpriseBySid/{sid}") |
||||
|
public ResultBean getEnterpriseBySid(@PathVariable String sid){ |
||||
|
ResultBean rb = ResultBean.fireFail(); |
||||
|
EnterpriseInformationVo EnterpriseInformationVo=EnterpriseInformationService.getEnterpriseBySid(sid); |
||||
|
return rb.success().setData(EnterpriseInformationVo); |
||||
|
} |
||||
|
@ApiOperation("根据条件分页查询数据的列表") |
||||
|
@DeleteMapping("/delete/{sid}") |
||||
|
public ResultBean delete(@PathVariable String sid) { |
||||
|
return EnterpriseInformationService.delete(sid); |
||||
|
} |
||||
|
} |
@ -0,0 +1,68 @@ |
|||||
|
package com.yxt.supervise.crm.biz.enterpriseinformation; |
||||
|
|
||||
|
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.supervise.crm.api.bankmanager.BankManagerVo; |
||||
|
import com.yxt.supervise.crm.api.enterpriseinformation.EnterpriseInformation; |
||||
|
import com.yxt.supervise.crm.api.enterpriseinformation.EnterpriseInformation; |
||||
|
import com.yxt.supervise.crm.api.enterpriseinformation.EnterpriseInformationDto; |
||||
|
import com.yxt.supervise.crm.api.enterpriseinformation.EnterpriseInformationQuery; |
||||
|
import com.yxt.supervise.crm.api.enterpriseinformation.EnterpriseInformationVo; |
||||
|
import org.apache.commons.lang3.StringUtils; |
||||
|
import org.springframework.stereotype.Service; |
||||
|
|
||||
|
import java.util.List; |
||||
|
|
||||
|
/** |
||||
|
* @author wangpengfei |
||||
|
* @date 2023/4/12 11:50 |
||||
|
*/ |
||||
|
@Service |
||||
|
public class EnterpriseInformationService extends MybatisBaseService<EnterpriseInformationMapper, EnterpriseInformation> { |
||||
|
public PagerVo<EnterpriseInformationVo> listPageVo(PagerQuery<EnterpriseInformationQuery> pq) { |
||||
|
EnterpriseInformationQuery query = pq.getParams(); |
||||
|
QueryWrapper<EnterpriseInformation> qw = new QueryWrapper<>(); |
||||
|
if(StringUtils.isNotBlank(query.getEnterpriseName())){ |
||||
|
qw.like("enterpriseName",query.getEnterpriseName()); |
||||
|
} |
||||
|
if(StringUtils.isNotBlank(query.getTelephone())){ |
||||
|
qw.like("telephone",query.getTelephone()); |
||||
|
} |
||||
|
|
||||
|
IPage<EnterpriseInformation> page = PagerUtil.queryToPage(pq); |
||||
|
IPage<EnterpriseInformationVo> pagging = baseMapper.selectPageVo(page, qw); |
||||
|
PagerVo<EnterpriseInformationVo> p = PagerUtil.pageToVo(pagging, null); |
||||
|
return p; |
||||
|
} |
||||
|
public ResultBean save(EnterpriseInformationDto dto) { |
||||
|
ResultBean rb=new ResultBean(); |
||||
|
EnterpriseInformation entity=new EnterpriseInformation(); |
||||
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
||||
|
baseMapper.insert(entity); |
||||
|
return rb.success().setMsg("保存企业信息成功"); |
||||
|
} |
||||
|
public ResultBean update(EnterpriseInformationDto dto) { |
||||
|
ResultBean rb=new ResultBean(); |
||||
|
String dtoSid = dto.getSid(); |
||||
|
EnterpriseInformation entity=fetchBySid(dtoSid); |
||||
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
||||
|
baseMapper.updateById(entity); |
||||
|
return rb.success().setMsg("修改企业信息成功"); |
||||
|
} |
||||
|
public EnterpriseInformationVo getEnterpriseBySid(String sid){ |
||||
|
//根据sid查询的企业
|
||||
|
EnterpriseInformationVo bank=baseMapper.getEnterpriseBySid(sid); |
||||
|
return bank; |
||||
|
} |
||||
|
public ResultBean delete(String sid) { |
||||
|
ResultBean rb=new ResultBean(); |
||||
|
baseMapper.delete(new QueryWrapper<EnterpriseInformation>().eq("sid",sid)); |
||||
|
return rb.success().setMsg("删除企业信息成功"); |
||||
|
} |
||||
|
} |
Loading…
Reference in new issue