|
|
|
|
@ -11,6 +11,7 @@ import com.flossom.common.core.domain.req.WxInstrumentSerialExportVm;
|
|
|
|
|
import com.flossom.common.core.domain.req.WxInstrumentSerialImportVm;
|
|
|
|
|
import com.flossom.common.core.domain.req.WxUserInstrumentExportVm;
|
|
|
|
|
import com.flossom.common.core.exception.ServiceException;
|
|
|
|
|
import com.flossom.common.core.exception.UtilException;
|
|
|
|
|
import com.flossom.common.core.utils.StringUtils;
|
|
|
|
|
import com.flossom.common.core.utils.poi.ExcelUtil;
|
|
|
|
|
import com.flossom.common.core.web.controller.BaseController;
|
|
|
|
|
@ -120,7 +121,7 @@ public class WxInstrumentSerialController extends BaseController
|
|
|
|
|
*/
|
|
|
|
|
@RequiresPermissions("system:instrumentSerial:remove")
|
|
|
|
|
@Log(title = "仪器序列号关联", businessType = BusinessType.DELETE)
|
|
|
|
|
@DeleteMapping("/{ids}")
|
|
|
|
|
@DeleteMapping("/{ids}")
|
|
|
|
|
public AjaxResult remove(@PathVariable Long[] ids)
|
|
|
|
|
{
|
|
|
|
|
return toAjax(wxInstrumentSerialService.deleteWxInstrumentSerialByIds(ids));
|
|
|
|
|
@ -164,15 +165,17 @@ public class WxInstrumentSerialController extends BaseController
|
|
|
|
|
{
|
|
|
|
|
String fileName = file.getOriginalFilename();
|
|
|
|
|
String suffix = fileName.substring(fileName.lastIndexOf("."));
|
|
|
|
|
if (!StringUtils.equals(suffix, "xls") || !StringUtils.equals(suffix, "xlsx")) {
|
|
|
|
|
if (!(StringUtils.equals(suffix, ".xls") || StringUtils.equals(suffix, ".xlsx"))) {
|
|
|
|
|
throw new ServiceException("请使用模板文件导入数据");
|
|
|
|
|
}
|
|
|
|
|
ExcelUtil<WxInstrumentSerialImportVm> util = new ExcelUtil<WxInstrumentSerialImportVm>(WxInstrumentSerialImportVm.class);
|
|
|
|
|
List<WxInstrumentSerialImportVm> WxInstrumentSerialImportList = util.importExcel(file.getInputStream());
|
|
|
|
|
String message = wxInstrumentSerialService.handleImportData(WxInstrumentSerialImportList);
|
|
|
|
|
// String operName = SecurityUtils.getUsername();
|
|
|
|
|
// String message = userService.importUser(userList, updateSupport, operName);
|
|
|
|
|
return success(message);
|
|
|
|
|
if(WxInstrumentSerialImportList == null ||WxInstrumentSerialImportList.isEmpty() || WxInstrumentSerialImportList.get(0) == null) {
|
|
|
|
|
throw new ServiceException("数据格式不正确,请检查模板数据");
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
String result = wxInstrumentSerialService.handleImportData(WxInstrumentSerialImportList);
|
|
|
|
|
return success(result);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|