失效列表
This commit is contained in:
@@ -16,4 +16,5 @@ public class LpkGoodsQuery implements Query {
|
||||
private String affiliation;
|
||||
private String brandId;
|
||||
private String periodValidity;
|
||||
private String now;
|
||||
}
|
||||
|
||||
@@ -33,6 +33,8 @@ public interface LpkGoodsMapper extends BaseMapper<LpkGoods> {
|
||||
LpkGoods getGoodsByName(@Param("goodName") String goodName);
|
||||
List<GiftBagGoods> getAllGoodsApplet();
|
||||
List<MyGoodsVo> getGoodsApplet( @Param("query") LpkGoodsQuery query);
|
||||
List<MyGoodsVo> getGoodsAppletInvalid( @Param("query") LpkGoodsQuery query);
|
||||
|
||||
List<GiftBagGoodss> getAllGoodsApplets(@Param("query") LpkGiftCardQuery query);
|
||||
List<GoodsTypeVo> getType();
|
||||
}
|
||||
|
||||
@@ -102,8 +102,32 @@
|
||||
LEFT JOIN lpk_goods s ON s.sid = r.goodsSid
|
||||
WHERE
|
||||
r.customerSid =#{query.customerSid} and r.affiliation =#{query.affiliation}
|
||||
and date_format(periodValidity,'%Y-%m-%d') >= date_format (#{query.now},'%Y-%m-%d')
|
||||
order by periodValidity desc
|
||||
</select>
|
||||
<select id="getGoodsAppletInvalid" resultType="com.yxt.yythmall.api.appletgiftbag.MyGoodsVo">
|
||||
SELECT
|
||||
s.sid AS goodsSid,
|
||||
date_format( s.createTime, '%Y-%m-%d' ) AS createTime,
|
||||
s.`name`,
|
||||
s.unitName,
|
||||
s.price AS jPrice,
|
||||
s.picUrl AS iconUrl,
|
||||
s.specificationUnit,
|
||||
s.isAppletGrounding,
|
||||
s.content AS remark,
|
||||
s.weight ,
|
||||
r.goodsNumber as goodsNumber,
|
||||
s.periodValidity
|
||||
FROM
|
||||
vegetable_cellar r
|
||||
LEFT JOIN lpk_goods s ON s.sid = r.goodsSid
|
||||
WHERE
|
||||
r.customerSid =#{query.customerSid}
|
||||
and date_format(periodValidity,'%Y-%m-%d') < date_format (#{query.now},'%Y-%m-%d')
|
||||
order by periodValidity desc
|
||||
</select>
|
||||
|
||||
<select id="getAllGoodsApplets" resultType="com.yxt.yythmall.api.appletgiftbag.GiftBagGoodss">
|
||||
select sid as goodsSid,
|
||||
date_format(createTime, '%Y-%m-%d') as createTime,
|
||||
|
||||
@@ -81,6 +81,12 @@ public class LpkGoodsRest {
|
||||
public ResultBean vegeCellarList(@RequestBody LpkGoodsQuery query) {
|
||||
return lpkGoodsService.vegeCellarList(query);
|
||||
}
|
||||
@ApiOperation("我的菜窖失效列表")
|
||||
@PostMapping("/vegeCellarInvalidList")
|
||||
public ResultBean vegeCellarInvalidList(@RequestBody LpkGoodsQuery query) {
|
||||
return lpkGoodsService.vegeCellarInvalidList(query);
|
||||
}
|
||||
|
||||
@ApiOperation("我的菜窖类别及数量")
|
||||
@PostMapping("/vegeCellarTypeList")
|
||||
public ResultBean vegeCellarTypeList(@RequestBody LpkGoodsQuery query) {
|
||||
|
||||
@@ -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());
|
||||
|
||||
@@ -115,6 +115,7 @@ public class SaTokenConfigure implements WebMvcConfigurer {
|
||||
.excludePathPatterns("/customerinvoice/saveOrUpdate")
|
||||
.excludePathPatterns("/invoicetype/listAll")
|
||||
.excludePathPatterns("/invoicerecords/save")
|
||||
.excludePathPatterns("/lpkgoods/vegeCellarInvalidList")
|
||||
.excludePathPatterns("//wxapi/**")
|
||||
;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user