|
@@ -15,14 +15,17 @@ import com.zhongzheng.modules.top.mall.bo.TopStoreQueryBo;
|
|
|
import com.zhongzheng.modules.top.mall.domain.TopStore;
|
|
import com.zhongzheng.modules.top.mall.domain.TopStore;
|
|
|
import com.zhongzheng.modules.top.mall.mapper.TopStoreMapper;
|
|
import com.zhongzheng.modules.top.mall.mapper.TopStoreMapper;
|
|
|
import com.zhongzheng.modules.top.mall.service.ITopStoreService;
|
|
import com.zhongzheng.modules.top.mall.service.ITopStoreService;
|
|
|
|
|
+import com.zhongzheng.modules.top.mall.vo.TopStoreExportVo;
|
|
|
import com.zhongzheng.modules.top.mall.vo.TopStoreVo;
|
|
import com.zhongzheng.modules.top.mall.vo.TopStoreVo;
|
|
|
import com.zhongzheng.modules.top.order.domain.TopOrderRecNote;
|
|
import com.zhongzheng.modules.top.order.domain.TopOrderRecNote;
|
|
|
|
|
+import com.zhongzheng.modules.top.order.vo.TopOldOrderCompanyExportVo;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
|
|
import com.github.pagehelper.Page;
|
|
import com.github.pagehelper.Page;
|
|
|
|
|
|
|
|
|
|
+import java.util.ArrayList;
|
|
|
import java.util.Collection;
|
|
import java.util.Collection;
|
|
|
import java.util.Collections;
|
|
import java.util.Collections;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
@@ -58,6 +61,23 @@ public class TopStoreServiceImpl extends ServiceImpl<TopStoreMapper, TopStore> i
|
|
|
return entity2Vo(this.list(lqw));
|
|
return entity2Vo(this.list(lqw));
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public List<TopStoreExportVo> listExport(TopStoreQueryBo bo) {
|
|
|
|
|
+ List<TopStoreExportVo> exportVoList = new ArrayList<>();
|
|
|
|
|
+ List<TopStoreVo> list = queryList(bo);
|
|
|
|
|
+ for(TopStoreVo vo : list){
|
|
|
|
|
+ TopStoreExportVo exportVo = BeanUtil.toBean(vo, TopStoreExportVo.class);
|
|
|
|
|
+ exportVo.setCreateTime(DateUtils.timestampToDate(vo.getCreateTime()));
|
|
|
|
|
+ if(vo.getStatus()==1){
|
|
|
|
|
+ exportVo.setStatus("启用");
|
|
|
|
|
+ }
|
|
|
|
|
+ if(vo.getStatus()==0){
|
|
|
|
|
+ exportVo.setStatus("禁用");
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return exportVoList;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
/**
|
|
/**
|
|
|
* 实体类转化成视图对象
|
|
* 实体类转化成视图对象
|
|
|
*
|
|
*
|
|
@@ -150,10 +170,10 @@ public class TopStoreServiceImpl extends ServiceImpl<TopStoreMapper, TopStore> i
|
|
|
if(Validator.isEmpty(bo.getStoreId())){
|
|
if(Validator.isEmpty(bo.getStoreId())){
|
|
|
throw new CustomException("参数错误");
|
|
throw new CustomException("参数错误");
|
|
|
}
|
|
}
|
|
|
- TopStoreVo storeVo = queryById(bo.getStoreId());
|
|
|
|
|
|
|
+ TopStore store = getOne(new LambdaQueryWrapper<TopStore>().eq(TopStore::getStoreId, bo.getStoreId()).last("limit 1"));
|
|
|
LambdaUpdateWrapper<TopStore> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
|
LambdaUpdateWrapper<TopStore> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
|
|
objectLambdaUpdateWrapper.eq(TopStore::getStoreId, bo.getStoreId());
|
|
objectLambdaUpdateWrapper.eq(TopStore::getStoreId, bo.getStoreId());
|
|
|
- objectLambdaUpdateWrapper.set(TopStore::getPassword, SecurityUtils.encryptPassword(storeVo.getInitPwd()));
|
|
|
|
|
|
|
+ objectLambdaUpdateWrapper.set(TopStore::getPassword, SecurityUtils.encryptPassword(store.getInitPwd()));
|
|
|
objectLambdaUpdateWrapper.set(TopStore::getUpdateTime, DateUtils.getNowTime());
|
|
objectLambdaUpdateWrapper.set(TopStore::getUpdateTime, DateUtils.getNowTime());
|
|
|
return this.update(null, objectLambdaUpdateWrapper);
|
|
return this.update(null, objectLambdaUpdateWrapper);
|
|
|
}
|
|
}
|
|
@@ -170,4 +190,18 @@ public class TopStoreServiceImpl extends ServiceImpl<TopStoreMapper, TopStore> i
|
|
|
objectLambdaUpdateWrapper.set(TopStore::getUpdateTime, DateUtils.getNowTime());
|
|
objectLambdaUpdateWrapper.set(TopStore::getUpdateTime, DateUtils.getNowTime());
|
|
|
return this.update(null, objectLambdaUpdateWrapper);
|
|
return this.update(null, objectLambdaUpdateWrapper);
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ @Override
|
|
|
|
|
+ public Boolean batchRemove(TopStoreEditBo bo) {
|
|
|
|
|
+ if(Validator.isNotEmpty(bo.getStoreIds())){
|
|
|
|
|
+ for(Long id : bo.getStoreIds()){
|
|
|
|
|
+ LambdaUpdateWrapper<TopStore> objectLambdaUpdateWrapper = Wrappers.lambdaUpdate();
|
|
|
|
|
+ objectLambdaUpdateWrapper.eq(TopStore::getStoreId, id);
|
|
|
|
|
+ objectLambdaUpdateWrapper.set(TopStore::getStatus, -1);
|
|
|
|
|
+ objectLambdaUpdateWrapper.set(TopStore::getUpdateTime, DateUtils.getNowTime());
|
|
|
|
|
+ this.update(null, objectLambdaUpdateWrapper);
|
|
|
|
|
+ }
|
|
|
|
|
+ }
|
|
|
|
|
+ return true;
|
|
|
|
|
+ }
|
|
|
}
|
|
}
|