榜单上传修改

product
landole 2 years ago
parent 4570d7bbc5
commit 126139a13c

@ -119,7 +119,7 @@ public class TradeuploadController {
@NoDataSourceBind() @NoDataSourceBind()
@ApiOperation("上传文件/图片") @ApiOperation("上传文件/图片")
@PostMapping(value = "/UploaderPondList/{type}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE) @PostMapping(value = "/UploaderPondList/{type}", consumes = MediaType.MULTIPART_FORM_DATA_VALUE)
public ActionResult uploader(@RequestPart("file") MultipartFile file, @PathVariable("type") String type) throws IOException { public ActionResult uploader(@RequestPart("file") MultipartFile file, @PathVariable("type") String type) throws IOException, ParseException {
String fileType = UpUtil.getFileType(file); String fileType = UpUtil.getFileType(file);
//验证类型 //验证类型
if (!OptimizeUtil.fileType(configValueUtil.getAllowUploadFileType(), fileType)) { if (!OptimizeUtil.fileType(configValueUtil.getAllowUploadFileType(), fileType)) {
@ -153,9 +153,13 @@ public class TradeuploadController {
}else if (i == 7){ }else if (i == 7){
array = object.getJSONArray("NetWeight"); array = object.getJSONArray("NetWeight");
} }
Map<String, String> params = new HashMap<>();
if(array != null && array.size() > 0){
JSONObject object1 = array.getJSONObject(0); JSONObject object1 = array.getJSONObject(0);
Map<String, String> params = JSONObject.parseObject(object1.toJSONString(), new TypeReference<Map<String, String>>() { params = JSONObject.parseObject(object1.toJSONString(), new TypeReference<Map<String, String>>() {
}); });
}
if (i == 0) { if (i == 0) {
map1.put("TareWeight", params.get("word")); map1.put("TareWeight", params.get("word"));
}else if (i == 1){ }else if (i == 1){
@ -216,18 +220,15 @@ public class TradeuploadController {
} }
} }
if (map1.get("PrintTime") == null) { if (map1.get("PrintTime") == null) {
tradeuploadCrForm.setPoundDate(new Date().getTime()); tradeuploadCrForm.setPoundDate(new Date());
} }
String printTime = String.valueOf(map1.get("PrintTime")); String printTime = String.valueOf(map1.get("PrintTime"));
String sdf = "yyyy-MM-dd" ; //String sdf = "yyyy-MM-dd" ;
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
if(printTime != null && printTime.length() == 10){ if(printTime != null && printTime.length() == 10){
if (dateStrIsValid(printTime, sdf)) { tradeuploadCrForm.setPoundDate(sdf.parse(printTime));
tradeuploadCrForm.setPoundDate(Long.valueOf(String.valueOf(map1.get("PrintTime"))));
}else {
tradeuploadCrForm.setPoundDate(new Date().getTime());
}
}else{ }else{
tradeuploadCrForm.setPoundDate(new Date().getTime()); tradeuploadCrForm.setPoundDate(new Date());
} }
if (map1.get("DeliveryNumber") == null) { if (map1.get("DeliveryNumber") == null) {
tradeuploadCrForm.setPoundlistNo(String.valueOf(new Date())); tradeuploadCrForm.setPoundlistNo(String.valueOf(new Date()));
@ -354,9 +355,9 @@ public class TradeuploadController {
tradeuploadCrForm.setVehiclePictures(vehicleEntity.getVehiclephotos()); tradeuploadCrForm.setVehiclePictures(vehicleEntity.getVehiclephotos());
} }
if (map.get("PrintTime") == null){ if (map.get("PrintTime") == null){
tradeuploadCrForm.setPoundDate(new Date().getTime()); tradeuploadCrForm.setPoundDate(new Date());
} }
tradeuploadCrForm.setPoundDate((Long) map.get("PrintTime")); //tradeuploadCrForm.setPoundDate(map.get("PrintTime"));
if (map.get("DeliveryNumber") == null){ if (map.get("DeliveryNumber") == null){
tradeuploadCrForm.setPoundlistNo(String.valueOf(new Date())); tradeuploadCrForm.setPoundlistNo(String.valueOf(new Date()));
} }

@ -5,6 +5,8 @@ package jnpf.tradeupload.model.tradeupload;
import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableField;
import jnpf.model.UploaderVO; import jnpf.model.UploaderVO;
import lombok.Data; import lombok.Data;
import java.util.Date;
import java.util.List; import java.util.List;
import java.math.BigDecimal; import java.math.BigDecimal;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;
@ -59,7 +61,7 @@ public class TradeuploadCrForm {
/** 磅单时间 **/ /** 磅单时间 **/
@JsonProperty("poundDate") @JsonProperty("poundDate")
private Long poundDate; private Date poundDate;
/** 磅单号 **/ /** 磅单号 **/
@JsonProperty("poundlistNo") @JsonProperty("poundlistNo")

Loading…
Cancel
Save