班前班后图片数据修改

main
dongdingding 9 months ago
parent 3380ca271d
commit 245a5a23c3

@ -0,0 +1,27 @@
package com.mudu.entity.dto.response;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
/**
* @author dong
* @since 2024/6/12 13:56
*/
@Data
@ApiModel("图片响应类")
public class XcTpResponse {
@ApiModelProperty("附件地址")
private String FJDZ;
@ApiModelProperty("附件后缀")
private String FJHZ;
@ApiModelProperty("附件类型")
private String FJLX;
@ApiModelProperty("附件名称")
private String FJMC;
}

@ -10,6 +10,7 @@ import com.mudu.entity.ASafeBqbhpx;
import com.mudu.entity.ASafeQyzypgl; import com.mudu.entity.ASafeQyzypgl;
import com.mudu.entity.dto.request.ASafeBqbhpxRequest; import com.mudu.entity.dto.request.ASafeBqbhpxRequest;
import com.mudu.entity.dto.request.ASafeQyzypglRequest; import com.mudu.entity.dto.request.ASafeQyzypglRequest;
import com.mudu.entity.dto.response.XcTpResponse;
import com.mudu.service.ASafeBqbhpxService; import com.mudu.service.ASafeBqbhpxService;
import com.mudu.service.ASafeQyzypglService; import com.mudu.service.ASafeQyzypglService;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
@ -70,8 +71,15 @@ public class BqbhTszyQuartz {
List<ASafeBqbhpxRequest> list = JSON.parseArray(dataList, ASafeBqbhpxRequest.class); List<ASafeBqbhpxRequest> list = JSON.parseArray(dataList, ASafeBqbhpxRequest.class);
list.forEach(x -> { list.forEach(x -> {
ASafeBqbhpx aSafeBqbhpx = BeanUtil.copyProperties(x, ASafeBqbhpx.class); ASafeBqbhpx aSafeBqbhpx = BeanUtil.copyProperties(x, ASafeBqbhpx.class);
XcTpResponse xcTpResponse = new XcTpResponse();
if (StrUtil.isNotEmpty(aSafeBqbhpx.getPxxctp())) { if (StrUtil.isNotEmpty(aSafeBqbhpx.getPxxctp())) {
aSafeBqbhpx.setPxxctp(api + aSafeBqbhpx.getPxxctp()); xcTpResponse.setFJDZ(api + aSafeBqbhpx.getPxxctp());
xcTpResponse.setFJHZ(aSafeBqbhpx.getPxxctp().substring(aSafeBqbhpx.getPxxctp().lastIndexOf(".") + 1));
xcTpResponse.setFJLX("");
xcTpResponse.setFJMC(aSafeBqbhpx.getPxxctp().substring(aSafeBqbhpx.getPxxctp().lastIndexOf("/") + 1));
//实体类转为JSONObject
JSONObject jsonObject = JSONObject.parseObject(JSON.toJSONString(xcTpResponse));
aSafeBqbhpx.setPxxctp(String.valueOf(jsonObject));
} }
aSafeBqbhpx.setQybh(x.getQyxxbh()); aSafeBqbhpx.setQybh(x.getQyxxbh());
aSafeBqbhpxes.add(aSafeBqbhpx); aSafeBqbhpxes.add(aSafeBqbhpx);

Loading…
Cancel
Save