| | |
| | | import com.yeshi.fanli.entity.bus.lable.Label;
|
| | | import com.yeshi.fanli.entity.bus.lable.LabelGoods;
|
| | | import com.yeshi.fanli.entity.common.AdminUser;
|
| | | import com.yeshi.fanli.exception.LabelException;
|
| | | import com.yeshi.fanli.log.LogHelper;
|
| | | import com.yeshi.fanli.exception.goods.quality.LabelException;
|
| | | import com.yeshi.fanli.service.inter.lable.LabelService;
|
| | | import com.yeshi.fanli.util.FilePathEnum;
|
| | | import com.yeshi.fanli.util.StringUtil;
|
| | |
|
| | | import jxl.Sheet;
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void insertList(List<Label> records,AdminUser admin) throws LabelException{
|
| | | if (records != null && records.size() > 0) {
|
| | | for (Label label : records) {
|
| | |
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void updateList(List<Label> records) throws LabelException{
|
| | | if (records != null && records.size() > 0) {
|
| | | for (Label label : records) {
|
| | |
| | |
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public int deleteBatchById(long[] ids) throws LabelException{
|
| | | return labelMapper.deleteBatchByPrimaryKey(ids);
|
| | | }
|
| | |
|
| | | @Override
|
| | | @Transactional
|
| | | @Transactional(rollbackFor=Exception.class)
|
| | | public void deleteBatchByPrimaryKey(List<Long> ids) throws LabelException {
|
| | | for (Long id : ids) {
|
| | | Label label = labelMapper.selectByPrimaryKey(id);
|
| | |
| | |
|
| | | @Override
|
| | | public List<Label> selectByTitle(String title) throws LabelException{
|
| | | LogHelper.test("查询标签: "+title);
|
| | | return labelMapper.selectByTitle(title);
|
| | | }
|
| | |
|
| | | |
| | | @Override
|
| | | @Cacheable(value = "labelCache",key="'selectByTitleCache-'+#labKey +'-'+#title")
|
| | | public List<Label> selectByTitleCache(String labKey, String title) throws LabelException{
|
| | | return selectByTitle(title);
|
| | | @Cacheable(value = "labelCache",key="'getByTitleCache-'+#labKey +'-'+#title")
|
| | | public Label getByTitleCache(String labKey, String title) throws LabelException{
|
| | | return labelMapper.getByTitle(title);
|
| | | }
|
| | | |
| | | |
| | | @Override
|
| | | @Cacheable(value = "labelCache",key="'listByTitlesCache-'+#list")
|
| | | public List<Label> listByTitlesCache(List<String> list){
|
| | | return labelMapper.listByTitles(list);
|
| | | }
|
| | |
|
| | |
|
| | |
| | | String contentType = file.getContentType();
|
| | | String type = contentType.substring(contentType.indexOf("/") + 1);
|
| | | // 上传文件相对位置
|
| | | String fileUrl="LableImg/"+UUID.randomUUID().toString().replace("-", "") + "." + type;
|
| | | String fileUrl=FilePathEnum.lable.getPath() + UUID.randomUUID().toString().replace("-", "") + "." + type;
|
| | |
|
| | | boolean deleteFile =true;
|
| | |
|