Commit df4e62ab authored by limei's avatar limei

设备管理附件上传

parent a5103e4c
......@@ -101,31 +101,31 @@ public class EquipmentServiceImpl extends BaseService<EquipmentDto, Equipment, E
*/
public void saveAttachment(JSONArray subForm,Long SequenceNbr){
AttachmentDto attachmentDto = new AttachmentDto();
attachmentDto.setInfo(JSON.toJSONString(subForm));
attachmentDto.setSourceId(SequenceNbr);
if (!subForm.isEmpty()){
for(Object o:subForm){
JSONObject jsonObject = JSON.parseObject(JSON.toJSONString(o));
jsonObject.getString("Symbol_key");
JSONArray jsonArray = jsonObject.getJSONArray("info");
for(Object j:jsonArray){
JSONObject info = JSON.parseObject(JSON.toJSONString(j));
String name = info.getString("name");
attachmentDto.setSourceId(SequenceNbr);
attachmentDto.setName(info.getString("name"));
// attachmentDto.setInfo("name: "+name+","+
// "type: "+name.substring(name.lastIndexOf(".")+1)+","+
// "path: "+info.getString("url")+","+
// "certCode: "+jsonObject.getString("certCode")+","+
// "certType: "+jsonObject.getString("certType"));
attachmentDto.setInfo(JSON.toJSONString(subForm));
attachmentDto.setType(name.substring(name.lastIndexOf(".")+1));
attachmentServiceImpl.createWithModel(attachmentDto);
if(!ValidationUtil.isEmpty(jsonArray)) {
for (Object j : jsonArray) {
JSONObject info = JSON.parseObject(JSON.toJSONString(j));
String name = info.getString("name");
attachmentDto.setName(info.getString("name"));
attachmentDto.setType(name.substring(name.lastIndexOf(".")+1));
break;
}
break;
}
}
attachmentServiceImpl.createWithModel(attachmentDto);
}
}
@Override
public EquipmentDto saveEI(JSONObject object) {
EquipmentDto model = new EquipmentDto();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment