| | |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.zy.acs.common.utils.GsonUtils; |
| | | import com.zy.acs.common.utils.QrCodeCodecSupport; |
| | | import com.zy.acs.framework.common.Cools; |
| | | import com.zy.acs.framework.common.R; |
| | | import com.zy.acs.framework.common.SnowflakeIdWorker; |
| | |
| | | List<Code> codes = codeService.list(); |
| | | List<Code> codeArr = param.getCodeArr(); |
| | | for (Code code : codeArr) { |
| | | code.setData(QrCodeCodecSupport.normalize(code.getData())); |
| | | Code one = codeService.getCacheByData(code.getData()); |
| | | if (one == null) { |
| | | if (!codeService.save(code)) { |
| | |
| | | throw new BusinessException(code.getData()+" update fail![Code]"); |
| | | } |
| | | } |
| | | codes.removeIf(next -> code.getData().equals(next.getData())); |
| | | codes.removeIf(next -> Objects.equals(next.getId(), one == null ? code.getId() : one.getId())); |
| | | } |
| | | for (Code code : codes) { |
| | | if (!codeService.removeById(code.getId())) { |