From 05dd698a0c1f61045c9644ccf7eadda90d719ac5 Mon Sep 17 00:00:00 2001 From: wangpengfei <1928057482@qq.com> Date: Thu, 15 May 2025 16:58:37 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BD=A6=E8=BE=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../anrui/vehfleet/VehfleetApplication.java | 2 +- .../vehfleet/api/AffiliatedCompanyRest.java | 62 ++++++++++ .../vehfleet/api/RegulatoryDocumentsRest.java | 62 ++++++++++ .../affiliatedcompany/AffiliatedCompany.java | 19 ++++ .../AffiliatedCompanyDto.java | 17 +++ .../AffiliatedCompanyMapper.java | 20 ++++ .../AffiliatedCompanyMapper.xml | 19 ++++ .../AffiliatedCompanyQuery.java | 14 +++ .../AffiliatedCompanyService.java | 68 +++++++++++ .../AffiliatedCompanyVo.java | 15 +++ .../anrui/vehfleet/biz/appendix/Appendix.java | 53 +++++++++ .../biz/appendix/AppendixDetailsVo.java | 52 +++++++++ .../vehfleet/biz/appendix/AppendixDto.java | 52 +++++++++ .../vehfleet/biz/appendix/AppendixMapper.java | 45 ++++++++ .../vehfleet/biz/appendix/AppendixMapper.xml | 15 +++ .../biz/appendix/AppendixService.java | 107 ++++++++++++++++++ .../RegulatoryDocuments.java | 24 ++++ .../RegulatoryDocumentsDto.java | 26 +++++ .../RegulatoryDocumentsMapper.java | 18 +++ .../RegulatoryDocumentsMapper.xml | 19 ++++ .../RegulatoryDocumentsQuery.java | 23 ++++ .../RegulatoryDocumentsService.java | 99 ++++++++++++++++ .../RegulatoryDocumentsVo.java | 29 +++++ 23 files changed, 859 insertions(+), 1 deletion(-) create mode 100644 yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/api/AffiliatedCompanyRest.java create mode 100644 yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/api/RegulatoryDocumentsRest.java create mode 100644 yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompany.java create mode 100644 yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyDto.java create mode 100644 yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyMapper.java create mode 100644 yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyMapper.xml create mode 100644 yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyQuery.java create mode 100644 yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyService.java create mode 100644 yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyVo.java create mode 100644 yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/Appendix.java create mode 100644 yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixDetailsVo.java create mode 100644 yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixDto.java create mode 100644 yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixMapper.java create mode 100644 yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixMapper.xml create mode 100644 yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixService.java create mode 100644 yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocuments.java create mode 100644 yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsDto.java create mode 100644 yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsMapper.java create mode 100644 yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsMapper.xml create mode 100644 yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsQuery.java create mode 100644 yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsService.java create mode 100644 yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsVo.java diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/VehfleetApplication.java b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/VehfleetApplication.java index d02f695e92..1d0b07b5cb 100644 --- a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/VehfleetApplication.java +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/VehfleetApplication.java @@ -11,7 +11,7 @@ import org.springframework.cloud.openfeign.EnableFeignClients; @EnableDiscoveryClient @SpringBootApplication(scanBasePackages = { "com.yxt.common.base.config", - "com.yxt.anrui.oa" + "com.yxt.anrui.vehfleet" }) @EnableFeignClients(basePackages = {"com.yxt.*.*"}) public class VehfleetApplication { diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/api/AffiliatedCompanyRest.java b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/api/AffiliatedCompanyRest.java new file mode 100644 index 0000000000..c2ebf9238f --- /dev/null +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/api/AffiliatedCompanyRest.java @@ -0,0 +1,62 @@ +package com.yxt.anrui.vehfleet.api; + +import com.yxt.anrui.vehfleet.biz.affiliatedcompany.*; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2025/5/14 10:12 + */ +@RestController +@RequestMapping("v1/affiliatedcompany") +public class AffiliatedCompanyRest { + @Autowired + AffiliatedCompanyService affiliatedCompanyService; + + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = affiliatedCompanyService.listPageVo(pq); + return rb.success().setData(pv); + } + @ApiOperation("查询全部") + @PostMapping("/list") + public ResultBean> list() { + ResultBean rb = ResultBean.fireFail(); + List pv = affiliatedCompanyService.list(); + return rb.success().setData(pv); + } + @ApiOperation("保存或者保存") + @PostMapping("/saveOrUpdate") + public ResultBean save(@RequestBody AffiliatedCompanyDto dto) { + return affiliatedCompanyService.saveOrUpdate(dto); + } + + @ApiOperation("根据sid查询数据") + @GetMapping("/fetchSid/{sid}") + public ResultBean getEnterpriseBySid(@PathVariable String sid){ + ResultBean rb = ResultBean.fireFail(); + AffiliatedCompanyVo AffiliatedCompanyVo=affiliatedCompanyService.fetchSid(sid); + return rb.success().setData(AffiliatedCompanyVo); + } + @ApiOperation("删除") + @DeleteMapping("/delete/{sid}") + public ResultBean delete(@PathVariable String sid) { + return affiliatedCompanyService.delete(sid); + } + @ApiOperation("根据sid批量删除") + @DeleteMapping("/delBySids") + public ResultBean delBySids(@RequestBody String[] sids) { + ResultBean rb = ResultBean.fireFail(); + affiliatedCompanyService.delAll(sids); + return rb.success(); + } +} diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/api/RegulatoryDocumentsRest.java b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/api/RegulatoryDocumentsRest.java new file mode 100644 index 0000000000..58b15d1183 --- /dev/null +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/api/RegulatoryDocumentsRest.java @@ -0,0 +1,62 @@ +package com.yxt.anrui.vehfleet.api; + +import com.yxt.anrui.vehfleet.biz.regulatorydocuments.*; +import com.yxt.common.core.query.PagerQuery; +import com.yxt.common.core.result.ResultBean; +import com.yxt.common.core.vo.PagerVo; +import io.swagger.annotations.ApiOperation; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2025/5/15 10:55 + */ +@RestController +@RequestMapping("v1/regulatorydocuments") +public class RegulatoryDocumentsRest { + @Autowired + RegulatoryDocumentsService regulatoryDocumentsService; + + @ApiOperation("根据条件分页查询数据的列表") + @PostMapping("/listPage") + public ResultBean> listPage(@RequestBody PagerQuery pq) { + ResultBean rb = ResultBean.fireFail(); + PagerVo pv = regulatoryDocumentsService.listPageVo(pq); + return rb.success().setData(pv); + } + @ApiOperation("查询全部") + @PostMapping("/list") + public ResultBean> list() { + ResultBean rb = ResultBean.fireFail(); + List pv = regulatoryDocumentsService.list(); + return rb.success().setData(pv); + } + @ApiOperation("保存或者保存") + @PostMapping("/saveOrUpdate") + public ResultBean save(@RequestBody RegulatoryDocumentsDto dto) { + return regulatoryDocumentsService.saveOrUpdate(dto); + } + + @ApiOperation("根据sid查询数据") + @GetMapping("/fetchSid/{sid}") + public ResultBean getEnterpriseBySid(@PathVariable String sid){ + ResultBean rb = ResultBean.fireFail(); + RegulatoryDocumentsVo RegulatoryDocumentsVo=regulatoryDocumentsService.fetchSid(sid); + return rb.success().setData(RegulatoryDocumentsVo); + } + @ApiOperation("删除") + @DeleteMapping("/delete/{sid}") + public ResultBean delete(@PathVariable String sid) { + return regulatoryDocumentsService.delete(sid); + } + @ApiOperation("根据sid批量删除") + @DeleteMapping("/delBySids") + public ResultBean delBySids(@RequestBody String[] sids) { + ResultBean rb = ResultBean.fireFail(); + regulatoryDocumentsService.delAll(sids); + return rb.success(); + } +} diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompany.java b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompany.java new file mode 100644 index 0000000000..2e7a6e601f --- /dev/null +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompany.java @@ -0,0 +1,19 @@ +package com.yxt.anrui.vehfleet.biz.affiliatedcompany; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.yxt.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2025/5/14 10:12 + */ +@Data +@ApiModel(value = "挂靠车辆", description = "挂靠车辆") +@TableName("affiliated_company") +public class AffiliatedCompany extends BaseEntity { + private String corporateName;//公司名称 + private String contacts;//联系人 + private String contactNumber;//联系方式 +} diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyDto.java b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyDto.java new file mode 100644 index 0000000000..9167be0012 --- /dev/null +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyDto.java @@ -0,0 +1,17 @@ +package com.yxt.anrui.vehfleet.biz.affiliatedcompany; + +import io.swagger.annotations.ApiModel; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2025/5/14 10:38 + */ +@ApiModel(value = "挂靠车辆 数据传输对象", description = "挂靠车辆 数据传输对象") +@Data +public class AffiliatedCompanyDto { + private String sid; + private String corporateName;//公司名称 + private String contacts;//联系人 + private String contactNumber;//联系方式 +} diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyMapper.java b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyMapper.java new file mode 100644 index 0000000000..397781a173 --- /dev/null +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyMapper.java @@ -0,0 +1,20 @@ +package com.yxt.anrui.vehfleet.biz.affiliatedcompany; + +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 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 AffiliatedCompanyMapper extends BaseMapper { + IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + AffiliatedCompanyVo fetchSid( @Param("sid") String sid); +} diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyMapper.xml b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyMapper.xml new file mode 100644 index 0000000000..9a63ddca45 --- /dev/null +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyMapper.xml @@ -0,0 +1,19 @@ + + + + + + + + + \ No newline at end of file diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyQuery.java b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyQuery.java new file mode 100644 index 0000000000..6ea1b7471d --- /dev/null +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyQuery.java @@ -0,0 +1,14 @@ +package com.yxt.anrui.vehfleet.biz.affiliatedcompany; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2025/5/14 10:39 + */ +@Data +public class AffiliatedCompanyQuery implements Query { + private String corporateName;//公司名称 + +} diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyService.java b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyService.java new file mode 100644 index 0000000000..c2c73bfa9a --- /dev/null +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyService.java @@ -0,0 +1,68 @@ + +package com.yxt.anrui.vehfleet.biz.affiliatedcompany; + +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 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 AffiliatedCompanyService extends MybatisBaseService { + public PagerVo listPageVo(PagerQuery pq) { + AffiliatedCompanyQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if(StringUtils.isNotBlank(query.getCorporateName())){ + qw.like("corporateName",query.getCorporateName()); + } + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + public ResultBean saveOrUpdate(AffiliatedCompanyDto dto) { + ResultBean rb=new ResultBean(); + String sid =dto.getSid(); + if(StringUtils.isNotBlank(sid)){ + AffiliatedCompany entity=fetchBySid(sid); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + return rb.success().setMsg("修改成功"); + }else{ + AffiliatedCompany entity=new AffiliatedCompany(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.insert(entity); + return rb.success().setMsg("保存成功"); + } + } + public AffiliatedCompanyVo fetchSid(String sid){ + //根据sid查询的企业 + AffiliatedCompanyVo bank=baseMapper.fetchSid(sid); + return bank; + } + public ResultBean delete(String sid) { + ResultBean rb=new ResultBean(); + baseMapper.delete(new QueryWrapper().eq("sid",sid)); + return rb.success().setMsg("删除成功"); + } + public List list(){ + return baseMapper.selectList(new QueryWrapper<>()); + + } + public ResultBean delAll(String[] sids) { + ResultBean rb = ResultBean.fireFail(); + delBySids(sids); + return rb.success(); + } +} diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyVo.java b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyVo.java new file mode 100644 index 0000000000..ac00a69a5a --- /dev/null +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyVo.java @@ -0,0 +1,15 @@ +package com.yxt.anrui.vehfleet.biz.affiliatedcompany; + +import lombok.Data; + +/** + * @author wangpengfei + * @date 2025/5/14 10:38 + */ +@Data +public class AffiliatedCompanyVo { + private String sid; + private String corporateName;//公司名称 + private String contacts;//联系人 + private String contactNumber;//联系方式 +} diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/Appendix.java b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/Appendix.java new file mode 100644 index 0000000000..d7d98969b6 --- /dev/null +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/Appendix.java @@ -0,0 +1,53 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.vehfleet.biz.appendix; + +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; + +@Data +@ApiModel(value = "附件表", description = "附件表") +@TableName("appendix") +public class Appendix extends BaseEntity { + private static final long serialVersionUID = 1L; + + @ApiModelProperty("文件名") + private String fileName; // 文件名 + @ApiModelProperty("文件类型") + private String fileType; // 文件类型 + @ApiModelProperty("关联业务对象sid") + private String linkSid; // 关联业务对象sid + @ApiModelProperty("附件类型") + private String attachType; // 附件类型 + @ApiModelProperty("文件大小") + private String fileSize; // 文件大小 + @ApiModelProperty("文件的路径") + private String filePath; // 文件的路径 + +} diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixDetailsVo.java b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixDetailsVo.java new file mode 100644 index 0000000000..f4dad5ab02 --- /dev/null +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixDetailsVo.java @@ -0,0 +1,52 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.vehfleet.biz.appendix; + +import com.yxt.common.core.vo.Vo; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "附件表 视图数据详情", description = "附件表 视图数据详情") +public class AppendixDetailsVo implements Vo { + + private String sid; // sid + + @ApiModelProperty("文件名") + private String fileName; // 文件名 + @ApiModelProperty("文件类型") + private String fileType; // 文件类型 + @ApiModelProperty("关联业务对象sid") + private String linkSid; // 关联业务对象sid + @ApiModelProperty("附件类型") + private String attachType; // 附件类型 + @ApiModelProperty("文件大小") + private String fileSize; // 文件大小 + @ApiModelProperty("文件的路径") + private String filePath; // 文件的路径 + +} \ No newline at end of file diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixDto.java b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixDto.java new file mode 100644 index 0000000000..739632bddc --- /dev/null +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixDto.java @@ -0,0 +1,52 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.vehfleet.biz.appendix; + +import com.yxt.common.core.dto.Dto; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +@Data +@ApiModel(value = "附件表 数据传输对象", description = "附件表 数据传输对象") +public class AppendixDto implements Dto { + + private String sid; // sid + + @ApiModelProperty("文件名") + private String fileName; // 文件名 + @ApiModelProperty("文件类型") + private String fileType; // 文件类型 + @ApiModelProperty("关联业务对象sid") + private String linkSid; // 关联业务对象sid + @ApiModelProperty("附件类型") + private String attachType; // 附件类型 + @ApiModelProperty("文件大小") + private String fileSize; // 文件大小 + @ApiModelProperty("文件的路径") + private String filePath; // 文件的路径 + +} \ No newline at end of file diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixMapper.java b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixMapper.java new file mode 100644 index 0000000000..d927fbaf32 --- /dev/null +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixMapper.java @@ -0,0 +1,45 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.vehfleet.biz.appendix; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; +import org.apache.ibatis.annotations.Select; + +import java.util.List; + +@Mapper +public interface AppendixMapper extends BaseMapper { + + @Select("select * from appendix where linkSid = #{linkSid}") + List fetchByLinkSid(String linkSid); + + int deleteByLinkSid(@Param("sid") String sid,@Param("fileType") String fileType); + + @Select("select * from appendix where linkSid = #{linkSid} and fileType = #{fileType}") + List fetchByLinkSid2(@Param("linkSid") String linkSid, @Param("fileType") String type); +} \ No newline at end of file diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixMapper.xml b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixMapper.xml new file mode 100644 index 0000000000..3ca04192cf --- /dev/null +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixMapper.xml @@ -0,0 +1,15 @@ + + + + + + + + delete + from appendix + where linkSid = #{sid} + + and fileType = #{fileType} + + + \ No newline at end of file diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixService.java b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixService.java new file mode 100644 index 0000000000..f79544dbd3 --- /dev/null +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixService.java @@ -0,0 +1,107 @@ +/********************************************************* + ********************************************************* + ******************** ******************* + ************* ************ + ******* _oo0oo_ ******* + *** o8888888o *** + * 88" . "88 * + * (| -_- |) * + * 0\ = /0 * + * ___/`---'\___ * + * .' \\| |// '. * + * / \\||| : |||// \ * + * / _||||| -:- |||||- \ * + * | | \\\ - /// | | * + * | \_| ''\---/'' |_/ | * + * \ .-\__ '-' ___/-. / * + * ___'. .' /--.--\ `. .'___ * + * ."" '< `.___\_<|>_/___.' >' "". * + * | | : `- \`.;`\ _ /`;.`/ - ` : | | * + * \ \ `_. \_ __\ /__ _/ .-` / / * + * =====`-.____`.___ \_____/___.-`___.-'===== * + * `=---=' * + * ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ * + *********__佛祖保佑__永无BUG__验收通过__钞票多多__********* + *********************************************************/ +package com.yxt.anrui.vehfleet.biz.appendix; + +import com.yxt.common.base.config.component.FileUploadComponent; +import com.yxt.common.base.service.MybatisBaseService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.ArrayList; +import java.util.List; + +@Service +public class AppendixService extends MybatisBaseService { + + @Autowired + private FileUploadComponent fileUploadComponent; + + public List fetchByLinkSid(String linkSid) { + return baseMapper.fetchByLinkSid(linkSid); + } + + public void saveOrUpdateFile(String sid, List oaAppendixList, String fileType) { + baseMapper.deleteByLinkSid(sid, fileType); + if (!oaAppendixList.isEmpty()) { + oaAppendixList.forEach(v -> { + baseMapper.insert(v); + }); + } + } + + public int deleteByLinkSid(String sid, String fileType) { + return baseMapper.deleteByLinkSid(sid, fileType); + } + + public void saveFile(String sid, List files, String attachType, String fileType) { + List oaAppendixList = new ArrayList<>(); + if (!files.isEmpty()) { + for (String file : files) { + String filePath = file.replace(fileUploadComponent.getUrlPrefix(), ""); + Appendix oaAppendix = new Appendix(); + oaAppendix.setLinkSid(sid); + oaAppendix.setAttachType(attachType); + oaAppendix.setFilePath(filePath); + /* File filess = new File(fileUploadComponent.getUploadPath() + file.replace("/", File.separator)); + if (file != null) { + try { + boolean isTrue = ImageIO.read(filess) != null; + if (isTrue) { + oaAppendix.setFileType("图片"); + } else { + oaAppendix.setFileType("文件"); + } + } catch (IOException e) { + e.printStackTrace(); + } + }*/ + oaAppendix.setFileType(fileType); + oaAppendixList.add(oaAppendix); + } + } + saveOrUpdateFile(sid, oaAppendixList, fileType); + } + + public List selectByLinkSid(String sid) { + List fileList = fetchByLinkSid(sid); + List files = new ArrayList<>(); + for (Appendix oaAppendix : fileList) { + String url = fileUploadComponent.getUrlPrefix() + oaAppendix.getFilePath(); + files.add(url); + } + return files; + } + + public List selectByLinkSid(String sid, String type) { + List fileList = baseMapper.fetchByLinkSid2(sid, type); + List files = new ArrayList<>(); + for (Appendix oaAppendix : fileList) { + String url = fileUploadComponent.getUrlPrefix() + oaAppendix.getFilePath(); + files.add(url); + } + return files; + } +} \ No newline at end of file diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocuments.java b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocuments.java new file mode 100644 index 0000000000..c85ae1bb6a --- /dev/null +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocuments.java @@ -0,0 +1,24 @@ +package com.yxt.anrui.vehfleet.biz.regulatorydocuments; + +import com.baomidou.mybatisplus.annotation.TableName; +import com.yxt.common.core.domain.BaseEntity; +import io.swagger.annotations.ApiModel; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2025/5/14 10:12 + */ +@Data +@ApiModel(value = "监管企业信息", description = "监管企业信息") +@TableName("regulatory_documents") +public class RegulatoryDocuments extends BaseEntity { + private String fileNameKey;//文件名 + private String fileNameValue; + private String departmentKey;//监管部门 + private String departmentValue; + private String fleetSid;//车队 + private String fleetName; + private String uploaderSid;//上传人 + private String uploaderName; +} diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsDto.java b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsDto.java new file mode 100644 index 0000000000..3cb3486908 --- /dev/null +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsDto.java @@ -0,0 +1,26 @@ +package com.yxt.anrui.vehfleet.biz.regulatorydocuments; + +import io.swagger.annotations.ApiModel; +import lombok.Data; + +import java.util.List; + +/** + * @author wangpengfei + * @date 2025/5/14 10:38 + */ +@ApiModel(value = "监管企业信息 数据传输对象", description = "监管企业信息 数据传输对象") +@Data +public class RegulatoryDocumentsDto { + private String sid; + private String remarks; + private String fileNameKey;//文件名 + private String fileNameValue; + private String departmentKey;//监管部门 + private String departmentValue; + private String fleetSid;//车队 + private String fleetName; + private String uploaderSid;//上传人 + private String uploaderName; + private List filePaths; +} diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsMapper.java b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsMapper.java new file mode 100644 index 0000000000..0f1f8c2caf --- /dev/null +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsMapper.java @@ -0,0 +1,18 @@ +package com.yxt.anrui.vehfleet.biz.regulatorydocuments; + +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 org.apache.ibatis.annotations.Mapper; +import org.apache.ibatis.annotations.Param; + +/** + * @author wangpengfei + * @date 2023/4/12 11:49 + */ +@Mapper +public interface RegulatoryDocumentsMapper extends BaseMapper { + IPage selectPageVo(IPage page, @Param(Constants.WRAPPER) Wrapper qw); + RegulatoryDocumentsVo fetchSid(@Param("sid") String sid); +} diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsMapper.xml b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsMapper.xml new file mode 100644 index 0000000000..39d680e9e4 --- /dev/null +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsMapper.xml @@ -0,0 +1,19 @@ + + + + + + + + + \ No newline at end of file diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsQuery.java b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsQuery.java new file mode 100644 index 0000000000..ab6659b694 --- /dev/null +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsQuery.java @@ -0,0 +1,23 @@ +package com.yxt.anrui.vehfleet.biz.regulatorydocuments; + +import com.yxt.common.core.query.Query; +import lombok.Data; + +/** + * @author wangpengfei + * @date 2025/5/14 10:39 + */ +@Data +public class RegulatoryDocumentsQuery implements Query { + + private String fileNameValue;//文件名 + + private String departmentValue;//部门 + private String fleetSid;//车队 + + private String uploaderName;//上传人 + private String remarks;//备注 + private String endTime; + private String startTime; + +} diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsService.java b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsService.java new file mode 100644 index 0000000000..93fac892f5 --- /dev/null +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsService.java @@ -0,0 +1,99 @@ + +package com.yxt.anrui.vehfleet.biz.regulatorydocuments; + +import cn.hutool.core.bean.BeanUtil; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.yxt.anrui.vehfleet.biz.appendix.AppendixService; +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 org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; + +import java.util.Collections; +import java.util.List; + +/** + * @author wangpengfei + * @date 2023/4/12 11:50 + */ +@Service +public class RegulatoryDocumentsService extends MybatisBaseService { + @Autowired + AppendixService appendixService; + public PagerVo listPageVo(PagerQuery pq) { + RegulatoryDocumentsQuery query = pq.getParams(); + QueryWrapper qw = new QueryWrapper<>(); + if(StringUtils.isNotBlank(query.getFileNameValue())){ + qw.eq("fileNameValue",query.getFileNameValue()); + } + if(StringUtils.isNotBlank(query.getDepartmentValue())){ + qw.eq("departmentValue",query.getDepartmentValue()); + } + if(StringUtils.isNotBlank(query.getFleetSid())){ + qw.eq("fleetSid",query.getFleetSid()); + } + if(StringUtils.isNotBlank(query.getUploaderName())){ + qw.like("uploaderName",query.getUploaderName()); + } + if(StringUtils.isNotBlank(query.getRemarks())){ + qw.like("remarks",query.getRemarks()); + } + qw.apply(com.yxt.common.base.utils.StringUtils.isNotBlank(query.getStartTime()), "date_format (createTime,'%Y-%m-%d') >= date_format('" + query.getStartTime() + "','%Y-%m-%d')"). + apply(com.yxt.common.base.utils.StringUtils.isNotBlank(query.getEndTime()), "date_format (createTime,'%Y-%m-%d') <= date_format('" + query.getEndTime() + "','%Y-%m-%d')" + ); + IPage page = PagerUtil.queryToPage(pq); + IPage pagging = baseMapper.selectPageVo(page, qw); + PagerVo p = PagerUtil.pageToVo(pagging, null); + return p; + } + public ResultBean saveOrUpdate(RegulatoryDocumentsDto dto) { + ResultBean rb=new ResultBean(); + String sid =dto.getSid(); + List files = dto.getFilePaths(); + if(StringUtils.isNotBlank(sid)){ + RegulatoryDocuments entity=fetchBySid(sid); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.updateById(entity); + }else{ + RegulatoryDocuments entity=new RegulatoryDocuments(); + BeanUtil.copyProperties(dto, entity, "id", "sid"); + baseMapper.insert(entity); + sid=entity.getSid(); + } + saveFiles(sid, files, "", "文件"); + return rb.success().setMsg("成功"); + } + private void saveFiles(String sid, List files, String attachType, String fileType) { + files.removeAll(Collections.singleton(null)); + appendixService.saveFile(sid, files, attachType, fileType); + } + public RegulatoryDocumentsVo fetchSid(String sid){ + RegulatoryDocumentsVo bank=baseMapper.fetchSid(sid); + List appes = appendixService.selectByLinkSid(sid, "文件"); + bank.setFilePaths(appes); + return bank; + } + public ResultBean delete(String sid) { + ResultBean rb=new ResultBean(); + baseMapper.delete(new QueryWrapper().eq("sid",sid)); + return rb.success().setMsg("删除成功"); + } + public List list(){ + return baseMapper.selectList(new QueryWrapper<>()); + + } + public ResultBean delAll(String[] sids) { + ResultBean rb = ResultBean.fireFail(); + delBySids(sids); + for (String sid : sids) { + appendixService.deleteByLinkSid(sid,"文件"); + } + + return rb.success(); + } +} diff --git a/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsVo.java b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsVo.java new file mode 100644 index 0000000000..39865f660b --- /dev/null +++ b/yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsVo.java @@ -0,0 +1,29 @@ +package com.yxt.anrui.vehfleet.biz.regulatorydocuments; + +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.util.Date; +import java.util.List; + +/** + * @author wangpengfei + * @date 2025/5/14 10:38 + */ +@Data +public class RegulatoryDocumentsVo { + private String sid; + private String remarks; + @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8") + private Date createTime; + private String fileNameKey;//文件名 + private String fileNameValue; + private String departmentKey;//监管部门 + private String departmentValue; + private String fleetSid;//车队 + private String fleetName; + private String uploaderSid;//上传人 + private String uploaderName; + private List filePaths; +}