Commit a42afe0a authored by chenzhao's avatar chenzhao

修复发货单详情接口

parent 4afaaf13
...@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.biz.common.dto.BaseDto; ...@@ -6,6 +6,7 @@ import com.yeejoin.amos.boot.biz.common.dto.BaseDto;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import java.util.Date; import java.util.Date;
import java.util.List;
/** /**
* *
...@@ -28,6 +29,6 @@ public class HygfReplenishmentDto extends BaseDto { ...@@ -28,6 +29,6 @@ public class HygfReplenishmentDto extends BaseDto {
private String comment; private String comment;
@ApiModelProperty(value = "补货文件") @ApiModelProperty(value = "补货文件")
private String file; private List<Object> file;
} }
...@@ -41,6 +41,6 @@ public class HygfReplenishment extends BaseEntity { ...@@ -41,6 +41,6 @@ public class HygfReplenishment extends BaseEntity {
* 补货文件 * 补货文件
*/ */
@TableField(value = "file" , typeHandler = FastjsonTypeHandler.class) @TableField(value = "file" , typeHandler = FastjsonTypeHandler.class)
private List<Object> file; private String file;
} }
...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField; ...@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName; import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler; import com.baomidou.mybatisplus.extension.handlers.FastjsonTypeHandler;
import com.yeejoin.amos.boot.biz.common.entity.BaseEntity; import com.yeejoin.amos.boot.biz.common.entity.BaseEntity;
import com.yeejoin.amos.boot.module.hygf.api.dto.HygfReplenishmentDto;
import lombok.Data; import lombok.Data;
import lombok.EqualsAndHashCode; import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors; import lombok.experimental.Accessors;
...@@ -150,7 +151,7 @@ public class PreparationMoney extends BaseEntity { ...@@ -150,7 +151,7 @@ public class PreparationMoney extends BaseEntity {
private List<PreparationMoneyLog> preparationMoneyLog; //发货单流水 private List<PreparationMoneyLog> preparationMoneyLog; //发货单流水
@TableField(exist = false) @TableField(exist = false)
private List<HygfReplenishment> files; //发货单流水 private List<HygfReplenishmentDto> files; //发货单流水
@TableField(exist = false) @TableField(exist = false)
private String instanceId; //发货单流水 private String instanceId; //发货单流水
......
...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.hygf.biz.service.impl; ...@@ -2,6 +2,7 @@ package com.yeejoin.amos.boot.module.hygf.biz.service.impl;
import cn.hutool.core.collection.CollUtil; import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
...@@ -189,11 +190,20 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -189,11 +190,20 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
List<DocumentStation> li = documentStationMapper.selectList(q); List<DocumentStation> li = documentStationMapper.selectList(q);
preparationMoney.setPeasantHouseholdId(li); preparationMoney.setPeasantHouseholdId(li);
LambdaUpdateWrapper<HygfReplenishment> h = new LambdaUpdateWrapper<>(); LambdaQueryWrapper<HygfReplenishment> h = new LambdaQueryWrapper<>();
h.eq(HygfReplenishment::getPreparationMoneyId,sequenceNbr); h.eq(HygfReplenishment::getPreparationMoneyId,sequenceNbr);
List<HygfReplenishment> hygfReplenishments = hygfReplenishmentMapper.selectList(h); List<HygfReplenishment> hygfReplenishments = hygfReplenishmentMapper.selectList(h);
if (CollectionUtil.isNotEmpty(hygfReplenishments) && hygfReplenishments.size()>0 ){ List<HygfReplenishmentDto> hygfReplenishmentDtos = new ArrayList<>();
preparationMoney.setFiles(hygfReplenishments); if (CollectionUtil.isNotEmpty(hygfReplenishments) && !hygfReplenishments.isEmpty() ){
hygfReplenishments.forEach(e->{
HygfReplenishmentDto hygfReplenishmentDto = new HygfReplenishmentDto();
BeanUtils.copyProperties(e,hygfReplenishmentDto);
hygfReplenishmentDto.setFile(JSON.parseArray(e.getFile()));
hygfReplenishmentDtos.add(hygfReplenishmentDto);
});
preparationMoney.setFiles(hygfReplenishmentDtos);
} }
return preparationMoney; return preparationMoney;
...@@ -314,8 +324,17 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto ...@@ -314,8 +324,17 @@ public class PreparationMoneyServiceImpl extends BaseService<PreparationMoneyDto
LambdaUpdateWrapper<HygfReplenishment> h = new LambdaUpdateWrapper<>(); LambdaUpdateWrapper<HygfReplenishment> h = new LambdaUpdateWrapper<>();
h.eq(HygfReplenishment::getPreparationMoneyId,sequenceNbr); h.eq(HygfReplenishment::getPreparationMoneyId,sequenceNbr);
List<HygfReplenishment> hygfReplenishments = hygfReplenishmentMapper.selectList(h); List<HygfReplenishment> hygfReplenishments = hygfReplenishmentMapper.selectList(h);
if (CollectionUtil.isNotEmpty(hygfReplenishments) && hygfReplenishments.size()>0 ){ List<HygfReplenishmentDto> hygfReplenishmentDtos = new ArrayList<>();
map2.put("files",hygfReplenishments); if (CollectionUtil.isNotEmpty(hygfReplenishments) && !hygfReplenishments.isEmpty() ){
hygfReplenishments.forEach(e->{
HygfReplenishmentDto hygfReplenishmentDto = new HygfReplenishmentDto();
BeanUtils.copyProperties(e,hygfReplenishmentDto);
hygfReplenishmentDto.setFile(JSON.parseArray(e.getFile()));
hygfReplenishmentDtos.add(hygfReplenishmentDto);
});
map2.put("files",hygfReplenishmentDtos);
} }
map.put("preparationMoney", map2); map.put("preparationMoney", map2);
......
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