|
@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.tofly.common.controller.CommonFileController;
|
|
|
import com.tofly.common.core.entity.ResultRespone;
|
|
|
import com.tofly.common.core.util.Qrqd.QRCodeMaker;
|
|
|
+import com.tofly.common.core.util.StringUtil;
|
|
|
import com.tofly.common.core.util.io.IOUtil;
|
|
|
import com.tofly.common.core.util.io.PdfUtil;
|
|
|
import com.tofly.common.log.annotation.ToFlyAppLog;
|
|
@@ -256,21 +257,25 @@ public class CustomStructureController {
|
|
|
@PostMapping("/structure/createPdf")
|
|
|
@SneakyThrows
|
|
|
public ResultRespone createPdf(MultipartFile file,String pbss) {
|
|
|
+
|
|
|
String filePath= IOUtil.TEMP_FILEPATH+SecurityUtils.getUserId()+"pdftemp";
|
|
|
File file1=new File(filePath);
|
|
|
if(!file1.exists()){
|
|
|
file1.mkdir();
|
|
|
}
|
|
|
- JSONArray jsonArray= JSONObject.parseArray(pbss);
|
|
|
- for(int i=0;i<jsonArray.size();i++){
|
|
|
- JSONObject jsonObject=jsonArray.getJSONObject(i);
|
|
|
- Iterator iter = jsonObject.entrySet().iterator();
|
|
|
- while (iter.hasNext()) {
|
|
|
- Map.Entry entry = (Map.Entry) iter.next();
|
|
|
- String key=(String)entry.getKey();
|
|
|
- QRCodeMaker.MakeQRCode((String)entry.getValue(),filePath+File.separator+key+".png",300,key);
|
|
|
+ if(StringUtil.isNotEmpty(pbss)){
|
|
|
+ JSONArray jsonArray= JSONObject.parseArray(pbss);
|
|
|
+ for(int i=0;i<jsonArray.size();i++){
|
|
|
+ JSONObject jsonObject=jsonArray.getJSONObject(i);
|
|
|
+ Iterator iter = jsonObject.entrySet().iterator();
|
|
|
+ while (iter.hasNext()) {
|
|
|
+ Map.Entry entry = (Map.Entry) iter.next();
|
|
|
+ String key=(String)entry.getKey();
|
|
|
+ QRCodeMaker.MakeQRCode((String)entry.getValue(),filePath+File.separator+key+".png",300,key);
|
|
|
+ }
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
String username=SecurityUtils.getUserName();
|
|
|
if(file!=null){
|
|
|
PdfUtil.imagesToPdfWithFristPic(IOUtil.TEMP_FILEPATH+username,file.getBytes(),filePath);
|
|
@@ -358,7 +363,7 @@ public class CustomStructureController {
|
|
|
.orderByAsc(Layerfields::getNum)
|
|
|
);
|
|
|
Map map = customStructureService.spatialData(code, layerName);
|
|
|
- list.parallelStream().forEach(m->m.put("value",map.get(((String)m.get("fieldEn")).toLowerCase())));
|
|
|
+ list.parallelStream().forEach(m->m.put("value",map.get(StringUtil.underlineToCamel(((String)m.get("fieldEn"))))));
|
|
|
return ResultRespone.success(list);
|
|
|
}
|
|
|
|