luodangjia
2024-08-22 e558a29e92ad35b7eec2ab9b4629535750bd7c8e
8.22
5个文件已修改
113 ■■■■ 已修改文件
ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/dto/ApplyChargingQuery.java 2 ●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/model/TApplyChargingPile.java 1 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TApplyChargingPileController.java 98 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/dto/TApplyChargingPileExportDto.java 12 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-service/ruoyi-chargingPile/src/main/resources/template/充电桩申请记录.xlsx 补丁 | 查看 | 原始文档 | blame | 历史
ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/dto/ApplyChargingQuery.java
@@ -5,5 +5,5 @@
@Data
public class ApplyChargingQuery extends BasePage {
    String name;
    String landlordPhone;
}
ruoyi-api/ruoyi-api-chargingPile/src/main/java/com/ruoyi/chargingPile/api/model/TApplyChargingPile.java
@@ -56,6 +56,7 @@
    @TableField("landlord_handling")
    private Integer landlordHandling;
    @ApiModelProperty(value = "户名")
    @TableField("landlord_name")
    private String landlordName;
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/controller/TApplyChargingPileController.java
@@ -5,6 +5,9 @@
import com.alibaba.excel.ExcelWriter;
import com.alibaba.excel.write.builder.ExcelWriterBuilder;
import com.alibaba.excel.write.metadata.WriteSheet;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.ruoyi.chargingPile.api.dto.ApplyChargingQuery;
import com.ruoyi.chargingPile.api.dto.ApplyChargingRemarkDto;
@@ -32,6 +35,7 @@
import java.net.URLEncoder;
import java.util.ArrayList;
import java.util.List;
import java.util.regex.Pattern;
/**
 * <p>
@@ -79,7 +83,7 @@
    @PostMapping(value = "/page")
    public AjaxResult<Page<TApplyChargingPile>> page(ApplyChargingQuery applyChargingQuery) {
        Page<TApplyChargingPile> page = applyChargingPileService.lambdaQuery()
                .like(applyChargingQuery.getName() != null && !applyChargingQuery.getName().equals(""), TApplyChargingPile::getAgentPhone, applyChargingQuery.getName())
                .like(applyChargingQuery.getLandlordPhone() != null && !applyChargingQuery.getLandlordPhone().equals(""), TApplyChargingPile::getLandlordPhone, applyChargingQuery.getLandlordPhone())
                .page(Page.of(applyChargingQuery.getPageCurr(), applyChargingQuery.getPageSize()));
        return AjaxResult.ok(page);
    }
@@ -104,15 +108,81 @@
            for (TApplyChargingPile tApplyChargingPile : list) {
                TApplyChargingPileExportDto applyChargingPileExportDto = new TApplyChargingPileExportDto();
                BeanUtils.copyProperties(tApplyChargingPile,applyChargingPileExportDto);
                applyChargingPileExportDto.setLandlordFrontIdCard(new URL(tApplyChargingPile.getLandlordFrontIdCard()));
                applyChargingPileExportDto.setLandlordBackIdCard(new URL(tApplyChargingPile.getLandlordBackIdCard()));
                applyChargingPileExportDto.setAgentBackIdCard(new URL(tApplyChargingPile.getAgentBackIdCard()));
                applyChargingPileExportDto.setAgentFrontIdCard(new URL(tApplyChargingPile.getAgentFrontIdCard()));
                List<URL> urls = new ArrayList<>();
                urls.add(new URL("https://img-blog.csdnimg.cn/direct/c11088e1790049a5b84a0fda21a271b1.png"));
                urls.add(new URL("https://img-blog.csdnimg.cn/direct/c11088e1790049a5b84a0fda21a271b1.png"));
                urls.add(new URL("https://img-blog.csdnimg.cn/direct/c11088e1790049a5b84a0fda21a271b1.png"));
                        applyChargingPileExportDto.setUrls(urls);
                JSONArray p1 = JSON.parseArray(tApplyChargingPile.getLandlordFrontIdCard());
                if (!p1.isEmpty()) {
                    applyChargingPileExportDto.setLandlordFrontIdCard(new URL((String) p1.get(0)));
                }
                JSONArray p2 = JSON.parseArray(tApplyChargingPile.getLandlordBackIdCard());
                if (!p2.isEmpty()){
                applyChargingPileExportDto.setLandlordBackIdCard(new URL((String)p2.get(0)));}
                JSONArray p3 = JSON.parseArray(tApplyChargingPile.getAgentBackIdCard());
                if (!p3.isEmpty())
                applyChargingPileExportDto.setAgentBackIdCard(new URL((String)p3.get(0)));
                JSONArray p4 = JSON.parseArray(tApplyChargingPile.getAgentFrontIdCard());
                if (!p4.isEmpty()) {
                    applyChargingPileExportDto.setAgentFrontIdCard(new URL((String)p4.get(0)));
                }
                if (tApplyChargingPile.getChargingPileUser()==1){
                    JSONArray pics1 = JSON.parseArray(tApplyChargingPile.getFixedParkingPropertyRights());
                    if (!pics1.isEmpty()) {
                        applyChargingPileExportDto.setPics1(new URL((String)pics1.get(0)));
                    }
                    JSONArray pics2 = JSON.parseArray(tApplyChargingPile.getConstructionCertificate());
                    if (!pics1.isEmpty()) {
                        applyChargingPileExportDto.setPics2(new URL((String)pics2.get(0)));
                    }
                }else {
                    JSONArray pics1 = JSON.parseArray(tApplyChargingPile.getTitleCertificate());
                    if (!pics1.isEmpty()) {
                        applyChargingPileExportDto.setPics1(new URL((String)pics1.get(0)));
                    }
                    JSONArray pics2 = JSON.parseArray(tApplyChargingPile.getBusinessLicense());
                    if (!pics1.isEmpty()) {
                        applyChargingPileExportDto.setPics2(new URL((String)pics2.get(0)));
                    }
                }
                JSONArray objects1 = JSON.parseArray(tApplyChargingPile.getFurtherInformation());
                for (int i = 0; i < objects1.size(); i++) {
                    JSONObject jsonObject = JSON.parseObject(objects1.get(i).toString());
                    System.err.println("==================="+jsonObject.get("url"));
                    boolean isImage = isImageUrl(jsonObject);
                    if (!isImage){
                        continue;
                    }
                    System.err.println("Is image: " + isImage);
                    if (i==0){
                        applyChargingPileExportDto.setUrl1(new URL((String)jsonObject.get("url")));
                    }else if (i==1){
                        applyChargingPileExportDto.setUrl2(new URL((String)jsonObject.get("url")));
                    }else if (i==2){
                        applyChargingPileExportDto.setUrl3(new URL((String)jsonObject.get("url")));
                    }else if (i==3){
                        applyChargingPileExportDto.setUrl4(new URL((String)jsonObject.get("url")));
                    }else if (i==4){
                        applyChargingPileExportDto.setUrl5(new URL((String)jsonObject.get("url")));
                    }else if (i==5){
                        applyChargingPileExportDto.setUrl6(new URL((String)jsonObject.get("url")));
                    }
                }
                if (tApplyChargingPile.getLandlordHandling()==1){
                    applyChargingPileExportDto.setIs1("是");
                }else {
                    applyChargingPileExportDto.setIs1("否");
                }
                if (tApplyChargingPile.getChargingPileUser()==1){
                    applyChargingPileExportDto.setIs2("是");
                }else {
                    applyChargingPileExportDto.setIs2("否");
                }
                if (tApplyChargingPile.getChargingPile()==1){
                    applyChargingPileExportDto.setIs3("是");
                }else {
                    applyChargingPileExportDto.setIs3("否");
                }
                exportDtos.add(applyChargingPileExportDto);
            }
@@ -134,6 +204,14 @@
        return R.ok();
    }
    public static boolean isImageUrl(JSONObject jsonObject) {
        String url = jsonObject.getString("url");
        Pattern pattern = Pattern.compile(
                "^.*\\.(?i)(jpg|jpeg|png|gif|bmp|webp)$"
        );
        return pattern.matcher(url).matches();
    }
    @ApiOperation(tags = {"后台-申请表单-申请建桩"},value = "详情")
    @PostMapping(value = "/detail/{id}")
    public AjaxResult<TApplyChargingPile> detail(@PathVariable Integer id) {
ruoyi-service/ruoyi-chargingPile/src/main/java/com/ruoyi/chargingPile/dto/TApplyChargingPileExportDto.java
@@ -109,5 +109,15 @@
    @ApiModelProperty(value = "备注")
    @TableField("remark")
    private String remark;
    private List<URL> urls;
    private URL pics1;
    private URL pics2;
    private URL url1;
    private URL url2;
    private URL url3;
    private URL url4;
    private URL url5;
    private URL url6;
    private String is1;
    private String is2;
    private String is3;
}
ruoyi-service/ruoyi-chargingPile/src/main/resources/template/充电桩申请记录.xlsx
Binary files differ