Compare commits

...

2 Commits

  1. 2
      yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/VehfleetApplication.java
  2. 62
      yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/api/AffiliatedCompanyRest.java
  3. 62
      yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/api/RegulatoryDocumentsRest.java
  4. 19
      yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompany.java
  5. 17
      yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyDto.java
  6. 20
      yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyMapper.java
  7. 19
      yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyMapper.xml
  8. 14
      yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyQuery.java
  9. 68
      yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyService.java
  10. 15
      yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyVo.java
  11. 53
      yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/Appendix.java
  12. 52
      yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixDetailsVo.java
  13. 52
      yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixDto.java
  14. 45
      yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixMapper.java
  15. 15
      yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixMapper.xml
  16. 107
      yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixService.java
  17. 24
      yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocuments.java
  18. 26
      yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsDto.java
  19. 18
      yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsMapper.java
  20. 19
      yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsMapper.xml
  21. 23
      yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsQuery.java
  22. 99
      yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsService.java
  23. 29
      yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsVo.java

2
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 {

62
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<PagerVo<AffiliatedCompanyVo>> listPage(@RequestBody PagerQuery<AffiliatedCompanyQuery> pq) {
ResultBean rb = ResultBean.fireFail();
PagerVo<AffiliatedCompanyVo> pv = affiliatedCompanyService.listPageVo(pq);
return rb.success().setData(pv);
}
@ApiOperation("查询全部")
@PostMapping("/list")
public ResultBean<List<AffiliatedCompany>> list() {
ResultBean rb = ResultBean.fireFail();
List<AffiliatedCompany> 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();
}
}

62
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<PagerVo<RegulatoryDocumentsVo>> listPage(@RequestBody PagerQuery<RegulatoryDocumentsQuery> pq) {
ResultBean rb = ResultBean.fireFail();
PagerVo<RegulatoryDocumentsVo> pv = regulatoryDocumentsService.listPageVo(pq);
return rb.success().setData(pv);
}
@ApiOperation("查询全部")
@PostMapping("/list")
public ResultBean<List<RegulatoryDocuments>> list() {
ResultBean rb = ResultBean.fireFail();
List<RegulatoryDocuments> 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();
}
}

19
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;//联系方式
}

17
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;//联系方式
}

20
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<AffiliatedCompany> {
IPage<AffiliatedCompanyVo> selectPageVo(IPage<AffiliatedCompany> page, @Param(Constants.WRAPPER) Wrapper<AffiliatedCompany> qw);
AffiliatedCompanyVo fetchSid( @Param("sid") String sid);
}

19
yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/affiliatedcompany/AffiliatedCompanyMapper.xml

@ -0,0 +1,19 @@
<?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.anrui.vehfleet.biz.affiliatedcompany.AffiliatedCompanyMapper">
<!-- <where> ${ew.sqlSegment} </where>-->
<!-- ${ew.customSqlSegment} -->
<select id="selectPageVo" resultType="com.yxt.anrui.vehfleet.biz.affiliatedcompany.AffiliatedCompanyVo">
SELECT *
FROM affiliated_company
<where>
${ew.sqlSegment}
</where>
</select>
<select id="fetchSid" resultType="com.yxt.anrui.vehfleet.biz.affiliatedcompany.AffiliatedCompanyVo">
SELECT *
FROM affiliated_company
WHERE sid=#{sid}
</select>
</mapper>

14
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;//公司名称
}

68
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<AffiliatedCompanyMapper, AffiliatedCompany> {
public PagerVo<AffiliatedCompanyVo> listPageVo(PagerQuery<AffiliatedCompanyQuery> pq) {
AffiliatedCompanyQuery query = pq.getParams();
QueryWrapper<AffiliatedCompany> qw = new QueryWrapper<>();
if(StringUtils.isNotBlank(query.getCorporateName())){
qw.like("corporateName",query.getCorporateName());
}
IPage<AffiliatedCompany> page = PagerUtil.queryToPage(pq);
IPage<AffiliatedCompanyVo> pagging = baseMapper.selectPageVo(page, qw);
PagerVo<AffiliatedCompanyVo> 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<AffiliatedCompany>().eq("sid",sid));
return rb.success().setMsg("删除成功");
}
public List<AffiliatedCompany> list(){
return baseMapper.selectList(new QueryWrapper<>());
}
public ResultBean delAll(String[] sids) {
ResultBean rb = ResultBean.fireFail();
delBySids(sids);
return rb.success();
}
}

15
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;//联系方式
}

53
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; // 文件的路径
}

52
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; // 文件的路径
}

52
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; // 文件的路径
}

45
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<Appendix> {
@Select("select * from appendix where linkSid = #{linkSid}")
List<Appendix> fetchByLinkSid(String linkSid);
int deleteByLinkSid(@Param("sid") String sid,@Param("fileType") String fileType);
@Select("select * from appendix where linkSid = #{linkSid} and fileType = #{fileType}")
List<Appendix> fetchByLinkSid2(@Param("linkSid") String linkSid, @Param("fileType") String type);
}

15
yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/appendix/AppendixMapper.xml

@ -0,0 +1,15 @@
<?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.anrui.vehfleet.biz.appendix.AppendixMapper">
<!-- <where> ${ew.sqlSegment} </where>-->
<!-- ${ew.customSqlSegment} -->
<delete id="deleteByLinkSid">
delete
from appendix
where linkSid = #{sid}
<if test="fileType != null and fileType != ''">
and fileType = #{fileType}
</if>
</delete>
</mapper>

107
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<AppendixMapper, Appendix> {
@Autowired
private FileUploadComponent fileUploadComponent;
public List<Appendix> fetchByLinkSid(String linkSid) {
return baseMapper.fetchByLinkSid(linkSid);
}
public void saveOrUpdateFile(String sid, List<Appendix> 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<String> files, String attachType, String fileType) {
List<Appendix> 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<String> selectByLinkSid(String sid) {
List<Appendix> fileList = fetchByLinkSid(sid);
List<String> files = new ArrayList<>();
for (Appendix oaAppendix : fileList) {
String url = fileUploadComponent.getUrlPrefix() + oaAppendix.getFilePath();
files.add(url);
}
return files;
}
public List<String> selectByLinkSid(String sid, String type) {
List<Appendix> fileList = baseMapper.fetchByLinkSid2(sid, type);
List<String> files = new ArrayList<>();
for (Appendix oaAppendix : fileList) {
String url = fileUploadComponent.getUrlPrefix() + oaAppendix.getFilePath();
files.add(url);
}
return files;
}
}

24
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;
}

26
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<String> filePaths;
}

18
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<RegulatoryDocuments> {
IPage<RegulatoryDocumentsVo> selectPageVo(IPage<RegulatoryDocuments> page, @Param(Constants.WRAPPER) Wrapper<RegulatoryDocuments> qw);
RegulatoryDocumentsVo fetchSid(@Param("sid") String sid);
}

19
yxt-vehfleet/src/main/java/com/yxt/anrui/vehfleet/biz/regulatorydocuments/RegulatoryDocumentsMapper.xml

@ -0,0 +1,19 @@
<?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.anrui.vehfleet.biz.regulatorydocuments.RegulatoryDocumentsMapper">
<!-- <where> ${ew.sqlSegment} </where>-->
<!-- ${ew.customSqlSegment} -->
<select id="selectPageVo" resultType="com.yxt.anrui.vehfleet.biz.regulatorydocuments.RegulatoryDocumentsVo">
SELECT *
FROM regulatory_documents
<where>
${ew.sqlSegment}
</where>
</select>
<select id="fetchSid" resultType="com.yxt.anrui.vehfleet.biz.regulatorydocuments.RegulatoryDocumentsVo">
SELECT *
FROM regulatory_documents
WHERE sid=#{sid}
</select>
</mapper>

23
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;
}

99
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<RegulatoryDocumentsMapper, RegulatoryDocuments> {
@Autowired
AppendixService appendixService;
public PagerVo<RegulatoryDocumentsVo> listPageVo(PagerQuery<RegulatoryDocumentsQuery> pq) {
RegulatoryDocumentsQuery query = pq.getParams();
QueryWrapper<RegulatoryDocuments> 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<RegulatoryDocuments> page = PagerUtil.queryToPage(pq);
IPage<RegulatoryDocumentsVo> pagging = baseMapper.selectPageVo(page, qw);
PagerVo<RegulatoryDocumentsVo> p = PagerUtil.pageToVo(pagging, null);
return p;
}
public ResultBean saveOrUpdate(RegulatoryDocumentsDto dto) {
ResultBean rb=new ResultBean();
String sid =dto.getSid();
List<String> 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<String> 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<String> appes = appendixService.selectByLinkSid(sid, "文件");
bank.setFilePaths(appes);
return bank;
}
public ResultBean delete(String sid) {
ResultBean rb=new ResultBean();
baseMapper.delete(new QueryWrapper<RegulatoryDocuments>().eq("sid",sid));
return rb.success().setMsg("删除成功");
}
public List<RegulatoryDocuments> 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();
}
}

29
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<String> filePaths;
}
Loading…
Cancel
Save