|
|
|
|
@ -1,5 +1,6 @@
|
|
|
|
|
package com.flossom.system.service.impl;
|
|
|
|
|
|
|
|
|
|
import java.util.Arrays;
|
|
|
|
|
import java.util.List;
|
|
|
|
|
import java.util.Objects;
|
|
|
|
|
import java.util.stream.Collectors;
|
|
|
|
|
@ -9,6 +10,7 @@ import com.flossom.common.core.domain.entity.WxInstrument;
|
|
|
|
|
import com.flossom.common.core.domain.entity.WxInstrumentSerial;
|
|
|
|
|
import com.flossom.common.core.domain.req.WxInstrumentSerialExportVm;
|
|
|
|
|
import com.flossom.common.core.domain.req.WxInstrumentSerialImportVm;
|
|
|
|
|
import com.flossom.common.core.enums.BindingStatusEnums;
|
|
|
|
|
import com.flossom.common.core.exception.ServiceException;
|
|
|
|
|
import com.flossom.common.core.mapper.WxInstrumentMapper;
|
|
|
|
|
import com.flossom.common.core.mapper.WxInstrumentSerialMapper;
|
|
|
|
|
@ -21,6 +23,7 @@ import org.springframework.beans.BeanUtils;
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
import com.flossom.system.service.IWxInstrumentSerialService;
|
|
|
|
|
import org.springframework.transaction.annotation.Transactional;
|
|
|
|
|
import org.springframework.util.CollectionUtils;
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
@ -121,8 +124,17 @@ public class WxInstrumentSerialServiceImpl implements IWxInstrumentSerialService
|
|
|
|
|
* @return 结果
|
|
|
|
|
*/
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public int deleteWxInstrumentSerialByIds(Long[] ids)
|
|
|
|
|
{
|
|
|
|
|
List<WxInstrumentSerial> wxInstrumentSerialList = wxInstrumentSerialMapper.selectWxInstrumentSerialByIdList(Arrays.asList(ids));
|
|
|
|
|
if (wxInstrumentSerialList != null && wxInstrumentSerialList.size() > 0) {
|
|
|
|
|
for (WxInstrumentSerial wxInstrumentSerial : wxInstrumentSerialList) {
|
|
|
|
|
if (wxInstrumentSerial.getBindingStatus() == BindingStatusEnums.BINDED.getCode()) {
|
|
|
|
|
throw new ServiceException("删除失败,只能删除已解绑状态的数据,您选中的内容存在【已绑定状态】请重试");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return wxInstrumentSerialMapper.deleteWxInstrumentSerialByIds(ids);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@ -139,7 +151,16 @@ public class WxInstrumentSerialServiceImpl implements IWxInstrumentSerialService
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
@Override
|
|
|
|
|
@Transactional
|
|
|
|
|
public int deleteAll() {
|
|
|
|
|
List<WxInstrumentSerial> wxInstrumentSerialList = wxInstrumentSerialMapper.selectWxInstrumentSerialList(new WxInstrumentSerial());
|
|
|
|
|
if (wxInstrumentSerialList != null && wxInstrumentSerialList.size() > 0) {
|
|
|
|
|
for (WxInstrumentSerial wxInstrumentSerial : wxInstrumentSerialList) {
|
|
|
|
|
if (wxInstrumentSerial.getBindingStatus() == BindingStatusEnums.BINDED.getCode()) {
|
|
|
|
|
throw new ServiceException("删除失败,只能删除已解绑状态的数据,您选中的内容存在【已绑定状态】请重试");
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return wxInstrumentSerialMapper.deleteAll();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|