|
|
@ -246,23 +246,35 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods |
|
|
|
if(StringUtils.isBlank(query.getAffiliation())){ |
|
|
|
return rb.setMsg("参数不全"); |
|
|
|
} |
|
|
|
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
query.setNow(sdf.format(new Date())); |
|
|
|
List<MyGoodsVo> vo =baseMapper.getGoodsApplet(query); |
|
|
|
vo.forEach(s->{ |
|
|
|
double i=Double.valueOf(s.getGoodsNumber()); |
|
|
|
s.setGoodsNumber(DoubleUtils.removeZeros(String.valueOf((int)i))); |
|
|
|
s.setWeight(DoubleUtils.removeZeros(s.getWeight())); |
|
|
|
s.setIconUrl(fileUploadComponent.getUrlPrefix()+s.getIconUrl()); |
|
|
|
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
if(s.getPeriodValidity()!=null){ |
|
|
|
//1>2 1 、1<2 -1 、1=2 0
|
|
|
|
int k= DateUtil.parse(sdf.format(s.getPeriodValidity())) .compareTo(DateUtil.parse(sdf.format(new Date()))); |
|
|
|
if(k==-1){ |
|
|
|
s.setState("1"); |
|
|
|
} |
|
|
|
} |
|
|
|
}); |
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
|
public ResultBean vegeCellarInvalidList(LpkGoodsQuery query) { |
|
|
|
ResultBean rb=new ResultBean().fail(); |
|
|
|
if(StringUtils.isBlank(query.getCustomerSid())){ |
|
|
|
return rb.setMsg("参数不全"); |
|
|
|
} |
|
|
|
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
query.setNow(sdf.format(new Date())); |
|
|
|
List<MyGoodsVo> vo =baseMapper.getGoodsAppletInvalid(query); |
|
|
|
vo.forEach(s->{ |
|
|
|
double i=Double.valueOf(s.getGoodsNumber()); |
|
|
|
s.setGoodsNumber(DoubleUtils.removeZeros(String.valueOf((int)i))); |
|
|
|
s.setWeight(DoubleUtils.removeZeros(s.getWeight())); |
|
|
|
s.setIconUrl(fileUploadComponent.getUrlPrefix()+s.getIconUrl()); |
|
|
|
}); |
|
|
|
return rb.success().setData(vo); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public ResultBean vegeCellarTypeList(LpkGoodsQuery query) { |
|
|
|
ResultBean rb=new ResultBean().fail(); |
|
|
|
if(StringUtils.isBlank(query.getCustomerSid())){ |
|
|
@ -273,6 +285,8 @@ public class LpkGoodsService extends MybatisBaseService<LpkGoodsMapper, LpkGoods |
|
|
|
for (BrandVo brandVo : list1) { |
|
|
|
GoodsTypeVo vo1=new GoodsTypeVo(); |
|
|
|
query.setAffiliation(brandVo.getId()); |
|
|
|
SimpleDateFormat sdf =new SimpleDateFormat("yyyy-MM-dd"); |
|
|
|
query.setNow(sdf.format(new Date())); |
|
|
|
List<MyGoodsVo> myGoodsVos =baseMapper.getGoodsApplet(query); |
|
|
|
vo1.setName(brandVo.getBrandName()); |
|
|
|
vo1.setId(brandVo.getId()); |
|
|
|