This commit is contained in:
葛林强 2025-03-07 09:08:55 +08:00
commit f9ca2384c8
32 changed files with 436 additions and 85 deletions

View File

@ -4,8 +4,10 @@ import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.ruoyi.app.domain.AppGoods; import com.ruoyi.app.domain.AppGoods;
import com.ruoyi.app.domain.AppLocation;
import com.ruoyi.app.service.IAppGoodsService; import com.ruoyi.app.service.IAppGoodsService;
import com.ruoyi.web.controller.section.EnhanceDataList; import com.ruoyi.web.controller.section.EnhanceDataList;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -22,6 +24,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/** /**
* 请填写功能名称Controller * 请填写功能名称Controller
@ -59,13 +62,30 @@ public class AppGoodsController extends BaseController {
util.exportExcel(response, list, "【请填写功能名称】数据"); util.exportExcel(response, list, "【请填写功能名称】数据");
} }
@Log(title = "物料导入", businessType = BusinessType.IMPORT)
@PreAuthorize("@ss.hasPermi('system:goods:import')")
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
ExcelUtil<AppGoods> util = new ExcelUtil<AppGoods>(AppGoods.class);
List<AppGoods> appGoodsList = util.importExcel(file.getInputStream());
String message = appGoodsService.importGoods(appGoodsList, updateSupport);
return success(message);
}
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response) {
ExcelUtil<AppGoods> util = new ExcelUtil<AppGoods>(AppGoods.class);
util.importTemplateExcel(response, "物料数据");
}
/** /**
* 获取请填写功能名称详细信息 * 获取请填写功能名称详细信息
*/ */
@PreAuthorize("@ss.hasPermi('system:goods:query')") @PreAuthorize("@ss.hasPermi('system:goods:query')")
@GetMapping(value = "/{goodsId}") @GetMapping(value = "/{goodsId}")
public AjaxResult getInfo(@PathVariable("goodsId") String goodsId) { public AjaxResult getInfo(@PathVariable("goodsId") String goodsId) {
return success(appGoodsService.selectAppGoodsByGoodsId(goodsId)); return success(appGoodsService.selectAppGoodsById(goodsId));
} }
/** /**
@ -75,6 +95,10 @@ public class AppGoodsController extends BaseController {
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT) @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody AppGoods appGoods) { public AjaxResult add(@RequestBody AppGoods appGoods) {
AppGoods oldAppGoods = appGoodsService.selectAppGoodsByGoodsId(appGoods.getGoodsId());
if (ObjectUtils.isNotEmpty(oldAppGoods)) {
return error("物料编码已存在");
}
return toAjax(appGoodsService.insertAppGoods(appGoods)); return toAjax(appGoodsService.insertAppGoods(appGoods));
} }
@ -85,6 +109,10 @@ public class AppGoodsController extends BaseController {
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE) @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody AppGoods appGoods) { public AjaxResult edit(@RequestBody AppGoods appGoods) {
AppGoods oldAppGoods = appGoodsService.selectAppGoodsByGoodsId(appGoods.getGoodsId());
if (ObjectUtils.isNotEmpty(oldAppGoods) && !oldAppGoods.getId().equals(appGoods.getId())) {
return error("物料编码已存在");
}
return toAjax(appGoodsService.updateAppGoods(appGoods)); return toAjax(appGoodsService.updateAppGoods(appGoods));
} }
@ -95,7 +123,7 @@ public class AppGoodsController extends BaseController {
@Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE) @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
@DeleteMapping("/{goodsIds}") @DeleteMapping("/{goodsIds}")
public AjaxResult remove(@PathVariable String[] goodsIds) { public AjaxResult remove(@PathVariable String[] goodsIds) {
return toAjax(appGoodsService.deleteAppGoodsByGoodsIds(goodsIds)); return toAjax(appGoodsService.deleteAppGoodsByIds(goodsIds));
} }
/** /**

View File

@ -7,6 +7,7 @@ import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult; import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;

View File

@ -4,14 +4,15 @@ import java.util.ArrayList;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import com.ruoyi.app.domain.AppLedConfig;
import com.ruoyi.app.domain.AppLocation; import com.ruoyi.app.domain.AppLocation;
import com.ruoyi.app.domain.AppVehicle;
import com.ruoyi.app.service.IAppLocationService; import com.ruoyi.app.service.IAppLocationService;
import com.ruoyi.common.annotation.Anonymous; import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.common.utils.StringUtils; import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.web.controller.section.EnhanceDataList; import com.ruoyi.web.controller.section.EnhanceDataList;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -28,6 +29,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType; import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil; import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo; import com.ruoyi.common.core.page.TableDataInfo;
import org.springframework.web.multipart.MultipartFile;
/** /**
* 请填写功能名称Controller * 请填写功能名称Controller
@ -66,13 +68,29 @@ public class AppLocationController extends BaseController {
util.exportExcel(response, list, "【请填写功能名称】数据"); util.exportExcel(response, list, "【请填写功能名称】数据");
} }
@Log(title = "库位导入", businessType = BusinessType.IMPORT)
@PreAuthorize("@ss.hasPermi('system:location:import')")
@PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
ExcelUtil<AppLocation> util = new ExcelUtil<AppLocation>(AppLocation.class);
List<AppLocation> locationList = util.importExcel(file.getInputStream());
String message = appLocationService.importLocation(locationList, updateSupport);
return success(message);
}
@PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response) {
ExcelUtil<AppLocation> util = new ExcelUtil<AppLocation>(AppLocation.class);
util.importTemplateExcel(response, "库位数据");
}
/** /**
* 获取请填写功能名称详细信息 * 获取请填写功能名称详细信息
*/ */
@PreAuthorize("@ss.hasPermi('system:location:query')") @PreAuthorize("@ss.hasPermi('system:location:query')")
@GetMapping(value = "/{locationId}") @GetMapping(value = "/{locationId}")
public AjaxResult getInfo(@PathVariable("locationId") String locationId) { public AjaxResult getInfo(@PathVariable("locationId") String locationId) {
return success(appLocationService.selectAppLocationByLocationId(locationId)); return success(appLocationService.selectAppLocationById(locationId));
} }
/** /**
@ -82,6 +100,10 @@ public class AppLocationController extends BaseController {
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT) @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody AppLocation appLocation) { public AjaxResult add(@RequestBody AppLocation appLocation) {
AppLocation oldAppLocation = appLocationService.selectAppLocationByLocationId(appLocation.getLocationId());
if (ObjectUtils.isNotEmpty(oldAppLocation)) {
return error("库位编码已存在");
}
return toAjax(appLocationService.insertAppLocation(appLocation)); return toAjax(appLocationService.insertAppLocation(appLocation));
} }
@ -92,6 +114,10 @@ public class AppLocationController extends BaseController {
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE) @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody AppLocation appLocation) { public AjaxResult edit(@RequestBody AppLocation appLocation) {
AppLocation oldAppLocation = appLocationService.selectAppLocationByLocationId(appLocation.getLocationId());
if (ObjectUtils.isNotEmpty(oldAppLocation) && !oldAppLocation.getId().equals(appLocation.getId())) {
return error("库位编码已存在");
}
return toAjax(appLocationService.updateAppLocation(appLocation)); return toAjax(appLocationService.updateAppLocation(appLocation));
} }
@ -102,14 +128,13 @@ public class AppLocationController extends BaseController {
@Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE) @Log(title = "【请填写功能名称】", businessType = BusinessType.DELETE)
@DeleteMapping("/{locationIds}") @DeleteMapping("/{locationIds}")
public AjaxResult remove(@PathVariable String[] locationIds) { public AjaxResult remove(@PathVariable String[] locationIds) {
return toAjax(appLocationService.deleteAppLocationByLocationIds(locationIds)); return toAjax(appLocationService.deleteAppLocationByIds(locationIds));
} }
/** /**
* 获取请填写功能名称详细信息 * 获取请填写功能名称详细信息
*/ */
@ApiOperation("生成库位") @ApiOperation("生成库位")
// @PreAuthorize("@ss.hasPermi('system:location:query')")
@GetMapping(value = "/genLocations/{areaId}") @GetMapping(value = "/genLocations/{areaId}")
@Anonymous @Anonymous
public AjaxResult genLocations(@PathVariable("areaId") Integer areaId) { public AjaxResult genLocations(@PathVariable("areaId") Integer areaId) {

View File

@ -7,6 +7,7 @@ import com.ruoyi.app.domain.AppProvider;
import com.ruoyi.app.domain.AppStand; import com.ruoyi.app.domain.AppStand;
import com.ruoyi.app.service.IAppStandService; import com.ruoyi.app.service.IAppStandService;
import com.ruoyi.web.controller.section.EnhanceDataList; import com.ruoyi.web.controller.section.EnhanceDataList;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -76,6 +77,10 @@ public class AppStandController extends BaseController {
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT) @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody AppStand appStand) { public AjaxResult add(@RequestBody AppStand appStand) {
AppStand oldAppStand = appStandService.selectAppStandByStandCode(appStand.getStandCode());
if (ObjectUtils.isNotEmpty(oldAppStand)) {
return error("站点编码已存在");
}
return toAjax(appStandService.insertAppStand(appStand)); return toAjax(appStandService.insertAppStand(appStand));
} }
@ -86,6 +91,10 @@ public class AppStandController extends BaseController {
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE) @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody AppStand appStand) { public AjaxResult edit(@RequestBody AppStand appStand) {
AppStand oldAppStand = appStandService.selectAppStandByStandCode(appStand.getStandCode());
if (ObjectUtils.isNotEmpty(oldAppStand) && !oldAppStand.getStandId().equals(appStand.getStandId())) {
return error("站点编码已存在");
}
return toAjax(appStandService.updateAppStand(appStand)); return toAjax(appStandService.updateAppStand(appStand));
} }

View File

@ -2,6 +2,8 @@ package com.ruoyi.web.controller.app;
import java.util.List; import java.util.List;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -75,8 +77,11 @@ public class AppStorageController extends BaseController
@PreAuthorize("@ss.hasPermi('app:storage:add')") @PreAuthorize("@ss.hasPermi('app:storage:add')")
@Log(title = "仓库", businessType = BusinessType.INSERT) @Log(title = "仓库", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody AppStorage appStorage) public AjaxResult add(@RequestBody AppStorage appStorage) {
{ AppStorage oldAppStorage = appStorageService.selectAppStorageByStorageId(appStorage.getStorageId());
if (ObjectUtils.isNotEmpty(oldAppStorage)) {
return error("仓库编码已存在");
}
return toAjax(appStorageService.insertAppStorage(appStorage)); return toAjax(appStorageService.insertAppStorage(appStorage));
} }
@ -86,8 +91,11 @@ public class AppStorageController extends BaseController
@PreAuthorize("@ss.hasPermi('app:storage:edit')") @PreAuthorize("@ss.hasPermi('app:storage:edit')")
@Log(title = "仓库", businessType = BusinessType.UPDATE) @Log(title = "仓库", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody AppStorage appStorage) public AjaxResult edit(@RequestBody AppStorage appStorage) {
{ AppStorage oldAppStorage = appStorageService.selectAppStorageByStorageId(appStorage.getStorageId());
if (ObjectUtils.isNotEmpty(oldAppStorage) && !oldAppStorage.getId().equals(appStorage.getId())) {
return error("仓库编码已存在");
}
return toAjax(appStorageService.updateAppStorage(appStorage)); return toAjax(appStorageService.updateAppStorage(appStorage));
} }

View File

@ -863,7 +863,7 @@ public class AppTaskController extends BaseController
} }
} }
/** /**
* 请求出库 * 请求出库
* @param outRequest 出库请求 * @param outRequest 出库请求

View File

@ -8,6 +8,7 @@ import com.ruoyi.app.domain.DTO.AppAvailVehicle;
import com.ruoyi.app.service.IAppVehicleService; import com.ruoyi.app.service.IAppVehicleService;
import com.ruoyi.common.annotation.Anonymous; import com.ruoyi.common.annotation.Anonymous;
import com.ruoyi.web.controller.section.EnhanceDataList; import com.ruoyi.web.controller.section.EnhanceDataList;
import org.apache.commons.lang3.ObjectUtils;
import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping; import org.springframework.web.bind.annotation.GetMapping;
@ -62,7 +63,7 @@ public class AppVehicleController extends BaseController {
util.exportExcel(response, list, "【请填写功能名称】数据"); util.exportExcel(response, list, "【请填写功能名称】数据");
} }
@Log(title = "容器管理", businessType = BusinessType.IMPORT) @Log(title = "容器导入", businessType = BusinessType.IMPORT)
@PreAuthorize("@ss.hasPermi('system:vehicle:import')") @PreAuthorize("@ss.hasPermi('system:vehicle:import')")
@PostMapping("/importData") @PostMapping("/importData")
public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception { public AjaxResult importData(MultipartFile file, boolean updateSupport) throws Exception {
@ -75,7 +76,7 @@ public class AppVehicleController extends BaseController {
@PostMapping("/importTemplate") @PostMapping("/importTemplate")
public void importTemplate(HttpServletResponse response) { public void importTemplate(HttpServletResponse response) {
ExcelUtil<AppVehicle> util = new ExcelUtil<AppVehicle>(AppVehicle.class); ExcelUtil<AppVehicle> util = new ExcelUtil<AppVehicle>(AppVehicle.class);
util.importTemplateExcel(response, "用户数据"); util.importTemplateExcel(response, "容器数据");
} }
/** /**
@ -94,6 +95,10 @@ public class AppVehicleController extends BaseController {
@Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT) @Log(title = "【请填写功能名称】", businessType = BusinessType.INSERT)
@PostMapping @PostMapping
public AjaxResult add(@RequestBody AppVehicle appVehicle) { public AjaxResult add(@RequestBody AppVehicle appVehicle) {
AppVehicle oldAppVehicle = appVehicleService.selectAppVehicleByVehicleCode(appVehicle.getVehicleCode());
if (ObjectUtils.isNotEmpty(oldAppVehicle)) {
return error("容器编码已存在");
}
return toAjax(appVehicleService.insertAppVehicle(appVehicle)); return toAjax(appVehicleService.insertAppVehicle(appVehicle));
} }
@ -104,6 +109,10 @@ public class AppVehicleController extends BaseController {
@Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE) @Log(title = "【请填写功能名称】", businessType = BusinessType.UPDATE)
@PutMapping @PutMapping
public AjaxResult edit(@RequestBody AppVehicle appVehicle) { public AjaxResult edit(@RequestBody AppVehicle appVehicle) {
AppVehicle oldAppVehicle = appVehicleService.selectAppVehicleByVehicleCode(appVehicle.getVehicleCode());
if (ObjectUtils.isNotEmpty(oldAppVehicle) && !oldAppVehicle.getVehicleId().equals(appVehicle.getVehicleId())) {
return error("容器编码已存在");
}
return toAjax(appVehicleService.updateAppVehicle(appVehicle)); return toAjax(appVehicleService.updateAppVehicle(appVehicle));
} }

View File

@ -17,6 +17,16 @@ public class AppConstants {
* 库位状态 0正常 1占用 * 库位状态 0正常 1占用
*/ */
public static final Integer LOCATION_STATUS_DISABLE = 1; public static final Integer LOCATION_STATUS_DISABLE = 1;
/**
* 物料状态 0 启用 1 禁用
*/
public static final Long GOODS_STATUS_ENABLE = 0L;
/**
* 物料状态 0 启用 1 禁用
*/
public static final Long GOODS_STATUS_DISABLE = 1L;
/** /**
* 出库状态 0 未完成 1 部分出库 2 全部出库 * 出库状态 0 未完成 1 部分出库 2 全部出库
*/ */
@ -27,8 +37,6 @@ public class AppConstants {
public static final Integer TASK_TYPE_OUT = 2; public static final Integer TASK_TYPE_OUT = 2;
public static final Integer TASK_TYPE_IN = 1; public static final Integer TASK_TYPE_IN = 1;
public static final Integer TASK_TYPE_TRANSFER = 3; public static final Integer TASK_TYPE_TRANSFER = 3;
public static final Long GOODS_STATUS_ENABLE = 0L;
public static final Long GOODS_STATUS_DISABLE = 1L;
// //
} }

View File

@ -58,7 +58,7 @@ public class AppGoods extends BaseEntity {
/** /**
* 物料状态 0 启用 1 禁用 * 物料状态 0 启用 1 禁用
*/ */
@Excel(name = "状态") @Excel(name = "状态", readConverterExp = "0=启用,1=禁用")
private Long goodsStatus; private Long goodsStatus;
/** /**

View File

@ -15,7 +15,13 @@ public class AppLocation extends BaseEntity
{ {
private static final Long serialVersionUID = 1L; private static final Long serialVersionUID = 1L;
/** 排 */ /**
* 主键
*/
private Long id;
/**
*
*/
@Excel(name = "货架排") @Excel(name = "货架排")
private Integer wRow; private Integer wRow;
@ -70,8 +76,15 @@ public class AppLocation extends BaseEntity
/** 是否在工作中 */ /** 是否在工作中 */
private Integer isWorking; private Integer isWorking;
public void setLocationId(String locationId) public Long getId() {
{ return id;
}
public void setId(Long id) {
this.id = id;
}
public void setLocationId(String locationId) {
this.locationId = locationId; this.locationId = locationId;
} }
@ -133,8 +146,11 @@ public class AppLocation extends BaseEntity
{ {
return equipmentId; return equipmentId;
} }
public void setwRow(Integer wRow)
{ public void setwRow(Integer wRow) {
this.wRow = wRow;
}
public void setWRow(Integer wRow) {
this.wRow = wRow; this.wRow = wRow;
} }
@ -142,17 +158,23 @@ public class AppLocation extends BaseEntity
{ {
return wRow; return wRow;
} }
public void setwCol(Integer wCol)
{
this.wCol = wCol;
}
public Integer getwCol() public Integer getwCol()
{ {
return wCol; return wCol;
} }
public void setwLayer(Integer wLayer)
{ public void setwCol(Integer wCol) {
this.wCol = wCol;
}
public void setWCol(Integer wCol) {
this.wCol = wCol;
}
public void setwLayer(Integer wLayer) {
this.wLayer = wLayer;
}
public void setWLayer(Integer wLayer) {
this.wLayer = wLayer; this.wLayer = wLayer;
} }

View File

@ -38,7 +38,7 @@ public class AppProvider extends BaseEntity
private String providerAddress; private String providerAddress;
/** 供应商状态 0 启用 1 停用*/ /** 供应商状态 0 启用 1 停用*/
@Excel(name = "状态") @Excel(name = "状态", readConverterExp = "0=启用,1=禁用")
private Long providerStatus; private Long providerStatus;
/** 类型 1 供应商 2 客户 */ /** 类型 1 供应商 2 客户 */

View File

@ -43,7 +43,7 @@ public class AppStand extends BaseEntity
private String remark; private String remark;
/** 状态 */ /** 状态 */
@Excel(name = "状态") @Excel(name = "状态", readConverterExp = "0=启用,1=禁用")
private Long standStatus; private Long standStatus;
/** 是否锁定 */ /** 是否锁定 */

View File

@ -50,16 +50,22 @@ public class AppStorage extends BaseEntity
// @Excel(name = "仓库联系人方式") // @Excel(name = "仓库联系人方式")
private String storageConcatsMobile; private String storageConcatsMobile;
/** 是否为立体库1:立体库 0平库 */ /**
@Excel(name = "立体库") * 是否为立体库1:立体库 0平库
*/
@Excel(name = "立体库", readConverterExp = "0=平库,1=立体库")
private String autoStatus; private String autoStatus;
/** 是否是AGV库 0否 1是 */ /**
@Excel(name = "AGV库") * 是否是AGV库 0 1
*/
@Excel(name = "AGV库", readConverterExp = "0=否,1=是")
private String isAgv; private String isAgv;
/** 是否可用 */ /**
@Excel(name = "是否可用") * 是否可用
*/
@Excel(name = "是否启用", readConverterExp = "0=启用,1=禁用")
private String status; private String status;
/** 仓储类型 1AGV 2堆垛机 3穿梭4 人工库 5 其他 */ /** 仓储类型 1AGV 2堆垛机 3穿梭4 人工库 5 其他 */

View File

@ -29,8 +29,10 @@ public class AppVehicle extends BaseEntity
@Excel(name = "容器类型") @Excel(name = "容器类型")
private String vehicleType; private String vehicleType;
/** 容器状态 0 空闲 1 占用 */ /**
@Excel(name = "容器状态") * 容器状态 0 空闲 1 占用
*/
@Excel(name = "容器状态", readConverterExp = "0=空闲,1=占用")
private Long vehicleStatus; private Long vehicleStatus;
/** 备注 */ /** 备注 */

View File

@ -18,7 +18,15 @@ public interface AppGoodsMapper
* @param goodsId 请填写功能名称主键 * @param goodsId 请填写功能名称主键
* @return 请填写功能名称 * @return 请填写功能名称
*/ */
public AppGoods selectAppGoodsByGoodsId(String goodsId); public AppGoods selectAppGoodsById(String goodsId);
/**
* 根据物料编码查询物料
*
* @param goodsId
* @return
*/
AppGoods selectAppGoodsByGoodsId(String goodsId);
/** /**
* 查询请填写功能名称列表 * 查询请填写功能名称列表
@ -50,7 +58,7 @@ public interface AppGoodsMapper
* @param goodsId 请填写功能名称主键 * @param goodsId 请填写功能名称主键
* @return 结果 * @return 结果
*/ */
public int deleteAppGoodsByGoodsId(String goodsId); public int deleteAppGoodsById(String goodsId);
/** /**
* 批量删除请填写功能名称 * 批量删除请填写功能名称
@ -58,7 +66,7 @@ public interface AppGoodsMapper
* @param goodsIds 需要删除的数据主键集合 * @param goodsIds 需要删除的数据主键集合
* @return 结果 * @return 结果
*/ */
public int deleteAppGoodsByGoodsIds(String[] goodsIds); public int deleteAppGoodsByIds(String[] goodsIds);
/** /**
@ -67,5 +75,6 @@ public interface AppGoodsMapper
* @param goodsIds * @param goodsIds
* @return * @return
*/ */
List<AppGoods> selectAppGoodsListByGoodsIds(String[] goodsIds); List<AppGoods> selectAppGoodsListByIds(String[] goodsIds);
} }

View File

@ -19,7 +19,7 @@ public interface AppLocationMapper
* @param locationId 请填写功能名称主键 * @param locationId 请填写功能名称主键
* @return 请填写功能名称 * @return 请填写功能名称
*/ */
AppLocation selectAppLocationByLocationId(String locationId); AppLocation selectAppLocationById(String locationId);
/** /**
* 查询请填写功能名称列表 * 查询请填写功能名称列表
@ -58,7 +58,7 @@ public interface AppLocationMapper
* @param locationId 请填写功能名称主键 * @param locationId 请填写功能名称主键
* @return 结果 * @return 结果
*/ */
int deleteAppLocationByLocationId(String locationId); int deleteAppLocationById(String locationId);
/** /**
* 批量删除请填写功能名称 * 批量删除请填写功能名称
@ -66,7 +66,7 @@ public interface AppLocationMapper
* @param locationIds 需要删除的数据主键集合 * @param locationIds 需要删除的数据主键集合
* @return 结果 * @return 结果
*/ */
int deleteAppLocationByLocationIds(String[] locationIds); int deleteAppLocationByIds(String[] locationIds);
Map<String, Integer> countAvailableStock(); Map<String, Integer> countAvailableStock();
@ -75,7 +75,15 @@ public interface AppLocationMapper
* @param locationIds * @param locationIds
* @return * @return
*/ */
List<AppLocation> selectAppLocationListByLocationIds(String[] locationIds); List<AppLocation> selectAppLocationListByIds(String[] locationIds);
List<AppLocation> selectFreeLoc(); List<AppLocation> selectFreeLoc();
/**
* 根据货位编码查询货位
* @param locationId
* @return
*/
AppLocation selectAppLocationByLocationId(String locationId);
} }

View File

@ -59,4 +59,12 @@ public interface AppStandMapper
* @return 结果 * @return 结果
*/ */
public int deleteAppStandByStandIds(String[] standIds); public int deleteAppStandByStandIds(String[] standIds);
/**
* 根据编码获取站点
*
* @param standCode
* @return
*/
AppStand selectAppStandByStandCode(String standCode);
} }

View File

@ -58,4 +58,12 @@ public interface AppStorageMapper
* @return 结果 * @return 结果
*/ */
public int deleteAppStorageByIds(Long[] ids); public int deleteAppStorageByIds(Long[] ids);
/**
* 根据仓库id查询仓库
*
* @param storageId
* @return
*/
AppStorage selectAppStorageByStorageId(String storageId);
} }

View File

@ -18,6 +18,13 @@ public interface IAppGoodsService
* @param goodsId 请填写功能名称主键 * @param goodsId 请填写功能名称主键
* @return 请填写功能名称 * @return 请填写功能名称
*/ */
public AppGoods selectAppGoodsById(String goodsId);
/**
* 根据物料编码查询物料
*
* @param goodsId 请填写功能名称主键
* @return 请填写功能名称
*/
public AppGoods selectAppGoodsByGoodsId(String goodsId); public AppGoods selectAppGoodsByGoodsId(String goodsId);
/** /**
@ -50,7 +57,7 @@ public interface IAppGoodsService
* @param goodsIds 需要删除的请填写功能名称主键集合 * @param goodsIds 需要删除的请填写功能名称主键集合
* @return 结果 * @return 结果
*/ */
public int deleteAppGoodsByGoodsIds(String[] goodsIds); public int deleteAppGoodsByIds(String[] goodsIds);
/** /**
* 删除请填写功能名称信息 * 删除请填写功能名称信息
@ -58,11 +65,20 @@ public interface IAppGoodsService
* @param goodsId 请填写功能名称主键 * @param goodsId 请填写功能名称主键
* @return 结果 * @return 结果
*/ */
public int deleteAppGoodsByGoodsId(String goodsId); public int deleteAppGoodsById(String goodsId);
/** /**
* 批量修改物料启用禁用状态 * 批量修改物料启用禁用状态
* @param goodsIds * @param goodsIds
*/ */
void changeGoodsIsEnableStatus(String[] goodsIds); void changeGoodsIsEnableStatus(String[] goodsIds);
/**
* 物料导入
*
* @param appGoodsList
* @param updateSupport
* @return
*/
String importGoods(List<AppGoods> appGoodsList, boolean updateSupport);
} }

View File

@ -18,7 +18,7 @@ public interface IAppLocationService {
* @param locationId 请填写功能名称主键 * @param locationId 请填写功能名称主键
* @return 请填写功能名称 * @return 请填写功能名称
*/ */
AppLocation selectAppLocationByLocationId(String locationId); AppLocation selectAppLocationById(String locationId);
/** /**
* 查询请填写功能名称列表 * 查询请填写功能名称列表
@ -58,7 +58,7 @@ public interface IAppLocationService {
* @param locationIds 需要删除的请填写功能名称主键集合 * @param locationIds 需要删除的请填写功能名称主键集合
* @return 结果 * @return 结果
*/ */
int deleteAppLocationByLocationIds(String[] locationIds); int deleteAppLocationByIds(String[] locationIds);
/** /**
* 删除请填写功能名称信息 * 删除请填写功能名称信息
@ -66,7 +66,7 @@ public interface IAppLocationService {
* @param locationId 请填写功能名称主键 * @param locationId 请填写功能名称主键
* @return 结果 * @return 结果
*/ */
int deleteAppLocationByLocationId(String locationId); int deleteAppLocationById(String locationId);
/** /**
* 请求库位 * 请求库位
@ -89,4 +89,20 @@ public interface IAppLocationService {
void changeIsEnableStatus(String[] locationIds); void changeIsEnableStatus(String[] locationIds);
List<AppLocation> selectFreeLoc(); List<AppLocation> selectFreeLoc();
/**
* 根据库位编码查询库位
*
* @param locId
* @return
*/
AppLocation selectAppLocationByLocationId(String locId);
/**
* 库位导入
* @param locationList
* @param updateSupport
* @return
*/
String importLocation(List<AppLocation> locationList, boolean updateSupport);
} }

View File

@ -20,6 +20,14 @@ public interface IAppStandService
*/ */
public AppStand selectAppStandByStandId(String standId); public AppStand selectAppStandByStandId(String standId);
/**
* 根据编码获取站点
*
* @param standCode
* @return
*/
AppStand selectAppStandByStandCode(String standCode);
/** /**
* 查询请填写功能名称列表 * 查询请填写功能名称列表
* *

View File

@ -58,4 +58,12 @@ public interface IAppStorageService
* @return 结果 * @return 结果
*/ */
public int deleteAppStorageById(Long id); public int deleteAppStorageById(Long id);
/**
* 根据仓库编码查询仓库
*
* @param storageId
* @return
*/
AppStorage selectAppStorageByStorageId(String storageId);
} }

View File

@ -20,6 +20,14 @@ public interface IAppVehicleService {
*/ */
public AppVehicle selectAppVehicleByVehicleId(String vehicleId); public AppVehicle selectAppVehicleByVehicleId(String vehicleId);
/**
* 根据容器编码查询容器
*
* @param vehicleCode
* @return
*/
AppVehicle selectAppVehicleByVehicleCode(String vehicleCode);
/** /**
* 查询请填写功能名称列表 * 查询请填写功能名称列表
* *

View File

@ -4,9 +4,14 @@ import java.util.List;
import cn.hutool.core.collection.CollectionUtil; import cn.hutool.core.collection.CollectionUtil;
import com.ruoyi.app.domain.AppGoods; import com.ruoyi.app.domain.AppGoods;
import com.ruoyi.app.domain.AppLocation;
import com.ruoyi.app.mapper.AppGoodsMapper; import com.ruoyi.app.mapper.AppGoodsMapper;
import com.ruoyi.app.service.IAppGoodsService; import com.ruoyi.app.service.IAppGoodsService;
import com.ruoyi.common.constant.AppConstants; import com.ruoyi.common.constant.AppConstants;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
@ -17,8 +22,8 @@ import org.springframework.stereotype.Service;
* @date 2025-01-15 * @date 2025-01-15
*/ */
@Service @Service
public class AppGoodsServiceImpl implements IAppGoodsService public class AppGoodsServiceImpl implements IAppGoodsService {
{ private static final Logger log = LoggerFactory.getLogger(AppGoodsServiceImpl.class);
@Autowired @Autowired
private AppGoodsMapper appGoodsMapper; private AppGoodsMapper appGoodsMapper;
@ -29,11 +34,15 @@ public class AppGoodsServiceImpl implements IAppGoodsService
* @return 请填写功能名称 * @return 请填写功能名称
*/ */
@Override @Override
public AppGoods selectAppGoodsByGoodsId(String goodsId) public AppGoods selectAppGoodsById(String goodsId)
{ {
return appGoodsMapper.selectAppGoodsByGoodsId(goodsId); return appGoodsMapper.selectAppGoodsById(goodsId);
} }
@Override
public AppGoods selectAppGoodsByGoodsId(String goodsId) {
return appGoodsMapper.selectAppGoodsByGoodsId(goodsId);
}
/** /**
* 查询请填写功能名称列表 * 查询请填写功能名称列表
* *
@ -77,9 +86,9 @@ public class AppGoodsServiceImpl implements IAppGoodsService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteAppGoodsByGoodsIds(String[] goodsIds) public int deleteAppGoodsByIds(String[] goodsIds)
{ {
return appGoodsMapper.deleteAppGoodsByGoodsIds(goodsIds); return appGoodsMapper.deleteAppGoodsByIds(goodsIds);
} }
/** /**
@ -89,14 +98,14 @@ public class AppGoodsServiceImpl implements IAppGoodsService
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteAppGoodsByGoodsId(String goodsId) public int deleteAppGoodsById(String goodsId)
{ {
return appGoodsMapper.deleteAppGoodsByGoodsId(goodsId); return appGoodsMapper.deleteAppGoodsById(goodsId);
} }
@Override @Override
public void changeGoodsIsEnableStatus(String[] goodsIds) { public void changeGoodsIsEnableStatus(String[] goodsIds) {
List<AppGoods> appGoodsList = appGoodsMapper.selectAppGoodsListByGoodsIds(goodsIds); List<AppGoods> appGoodsList = appGoodsMapper.selectAppGoodsListByIds(goodsIds);
if (CollectionUtil.isNotEmpty(appGoodsList)) { if (CollectionUtil.isNotEmpty(appGoodsList)) {
appGoodsList.forEach(appGoods -> { appGoodsList.forEach(appGoods -> {
Long oldIsEnabled = appGoods.getGoodsStatus(); Long oldIsEnabled = appGoods.getGoodsStatus();
@ -109,4 +118,45 @@ public class AppGoodsServiceImpl implements IAppGoodsService
}); });
} }
} }
@Override
public String importGoods(List<AppGoods> appGoodsList, boolean isUpdateSupport) {
if (CollectionUtil.isEmpty(appGoodsList)) {
throw new ServiceException("导入库位数据不能为空!");
}
int successNum = 0;
int failureNum = 0;
StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder();
for (AppGoods appGoods : appGoodsList) {
try {
// 验证是否存在这个物料编码
AppGoods u = appGoodsMapper.selectAppGoodsByGoodsId(appGoods.getGoodsId());
if (StringUtils.isNull(u)) {
appGoodsMapper.insertAppGoods(appGoods);
successNum++;
successMsg.append("<br/>" + successNum + "、物料 " + appGoods.getGoodsId() + " 导入成功");
} else if (isUpdateSupport) {
appGoodsMapper.updateAppGoods(appGoods);
successNum++;
successMsg.append("<br/>" + successNum + "、物料 " + appGoods.getGoodsId() + " 更新成功");
} else {
failureNum++;
failureMsg.append("<br/>" + failureNum + "、物料 " + appGoods.getGoodsId() + " 已存在");
}
} catch (Exception e) {
failureNum++;
String msg = "<br/>" + failureNum + "、物料 " + appGoods.getGoodsId() + " 导入失败:";
failureMsg.append(msg + e.getMessage());
log.error(msg, e);
}
}
if (failureNum > 0) {
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
throw new ServiceException(failureMsg.toString());
} else {
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
}
return successMsg.toString();
}
} }

View File

@ -12,6 +12,10 @@ import com.ruoyi.app.domain.AppLocation;
import com.ruoyi.app.mapper.AppLocationMapper; import com.ruoyi.app.mapper.AppLocationMapper;
import com.ruoyi.app.service.IAppLocationService; import com.ruoyi.app.service.IAppLocationService;
import com.ruoyi.common.constant.AppConstants; import com.ruoyi.common.constant.AppConstants;
import com.ruoyi.common.exception.ServiceException;
import com.ruoyi.common.utils.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -24,6 +28,8 @@ import org.springframework.transaction.annotation.Transactional;
*/ */
@Service @Service
public class AppLocationServiceImpl implements IAppLocationService { public class AppLocationServiceImpl implements IAppLocationService {
private static final Logger log = LoggerFactory.getLogger(AppLocationServiceImpl.class);
@Autowired @Autowired
private AppLocationMapper appLocationMapper; private AppLocationMapper appLocationMapper;
@ -34,8 +40,8 @@ public class AppLocationServiceImpl implements IAppLocationService {
* @return 请填写功能名称 * @return 请填写功能名称
*/ */
@Override @Override
public AppLocation selectAppLocationByLocationId(String locationId) { public AppLocation selectAppLocationById(String locationId) {
return appLocationMapper.selectAppLocationByLocationId(locationId); return appLocationMapper.selectAppLocationById(locationId);
} }
/** /**
@ -92,8 +98,8 @@ public class AppLocationServiceImpl implements IAppLocationService {
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteAppLocationByLocationIds(String[] locationIds) { public int deleteAppLocationByIds(String[] locationIds) {
return appLocationMapper.deleteAppLocationByLocationIds(locationIds); return appLocationMapper.deleteAppLocationByIds(locationIds);
} }
/** /**
@ -103,8 +109,8 @@ public class AppLocationServiceImpl implements IAppLocationService {
* @return 结果 * @return 结果
*/ */
@Override @Override
public int deleteAppLocationByLocationId(String locationId) { public int deleteAppLocationById(String locationId) {
return appLocationMapper.deleteAppLocationByLocationId(locationId); return appLocationMapper.deleteAppLocationById(locationId);
} }
/** /**
@ -227,7 +233,7 @@ public class AppLocationServiceImpl implements IAppLocationService {
@Override @Override
public void changeIsEnableStatus(String[] locationIds) { public void changeIsEnableStatus(String[] locationIds) {
List<AppLocation> appLocationList = appLocationMapper.selectAppLocationListByLocationIds(locationIds); List<AppLocation> appLocationList = appLocationMapper.selectAppLocationListByIds(locationIds);
if (CollectionUtil.isNotEmpty(appLocationList)) { if (CollectionUtil.isNotEmpty(appLocationList)) {
appLocationList.forEach(appLocation -> { appLocationList.forEach(appLocation -> {
Integer oldIsEnabled = appLocation.getIsEnable(); Integer oldIsEnabled = appLocation.getIsEnable();
@ -245,4 +251,50 @@ public class AppLocationServiceImpl implements IAppLocationService {
public List<AppLocation> selectFreeLoc() { public List<AppLocation> selectFreeLoc() {
return appLocationMapper.selectFreeLoc(); return appLocationMapper.selectFreeLoc();
} }
@Override
public AppLocation selectAppLocationByLocationId(String locationId) {
return appLocationMapper.selectAppLocationByLocationId(locationId);
}
@Override
public String importLocation(List<AppLocation> locationList, boolean isUpdateSupport) {
if (CollectionUtil.isEmpty(locationList)) {
throw new ServiceException("导入库位数据不能为空!");
}
int successNum = 0;
int failureNum = 0;
StringBuilder successMsg = new StringBuilder();
StringBuilder failureMsg = new StringBuilder();
for (AppLocation appLocation : locationList) {
try {
// 验证是否存在这个容器编码
AppLocation u = appLocationMapper.selectAppLocationByLocationId(appLocation.getLocationId());
if (StringUtils.isNull(u)) {
appLocationMapper.insertAppLocation(appLocation);
successNum++;
successMsg.append("<br/>" + successNum + "、库位 " + appLocation.getLocationId() + " 导入成功");
} else if (isUpdateSupport) {
appLocationMapper.updateAppLocation(appLocation);
successNum++;
successMsg.append("<br/>" + successNum + "、库位 " + appLocation.getLocationId() + " 更新成功");
} else {
failureNum++;
failureMsg.append("<br/>" + failureNum + "、库位 " + appLocation.getLocationId() + " 已存在");
}
} catch (Exception e) {
failureNum++;
String msg = "<br/>" + failureNum + "、库位 " + appLocation.getLocationId() + " 导入失败:";
failureMsg.append(msg + e.getMessage());
log.error(msg, e);
}
}
if (failureNum > 0) {
failureMsg.insert(0, "很抱歉,导入失败!共 " + failureNum + " 条数据格式不正确,错误如下:");
throw new ServiceException(failureMsg.toString());
} else {
successMsg.insert(0, "恭喜您,数据已全部导入成功!共 " + successNum + " 条,数据如下:");
}
return successMsg.toString();
}
} }

View File

@ -32,6 +32,11 @@ public class AppStandServiceImpl implements IAppStandService
return appStandMapper.selectAppStandByStandId(standId); return appStandMapper.selectAppStandByStandId(standId);
} }
@Override
public AppStand selectAppStandByStandCode(String standCode) {
return appStandMapper.selectAppStandByStandCode(standCode);
}
/** /**
* 查询请填写功能名称列表 * 查询请填写功能名称列表
* *

View File

@ -32,6 +32,12 @@ public class AppStorageServiceImpl implements IAppStorageService
return appStorageMapper.selectAppStorageById(id); return appStorageMapper.selectAppStorageById(id);
} }
@Override
public AppStorage selectAppStorageByStorageId(String storageId) {
return appStorageMapper.selectAppStorageByStorageId(storageId);
}
/** /**
* 查询仓库列表 * 查询仓库列表
* *

View File

@ -41,6 +41,11 @@ public class AppVehicleServiceImpl implements IAppVehicleService {
return appVehicleMapper.selectAppVehicleByVehicleId(vehicleId); return appVehicleMapper.selectAppVehicleByVehicleId(vehicleId);
} }
@Override
public AppVehicle selectAppVehicleByVehicleCode(String vehicleCode) {
return appVehicleMapper.selectAppVehicleByVehicleCode(vehicleCode);
}
/** /**
* 查询请填写功能名称列表 * 查询请填写功能名称列表
* *
@ -136,11 +141,11 @@ public class AppVehicleServiceImpl implements IAppVehicleService {
if (StringUtils.isNull(u)) { if (StringUtils.isNull(u)) {
appVehicleMapper.insertAppVehicle(appVehicle); appVehicleMapper.insertAppVehicle(appVehicle);
successNum++; successNum++;
successMsg.append("<br/>" + successNum + "账号 " + appVehicle.getVehicleCode() + " 导入成功"); successMsg.append("<br/>" + successNum + "容器 " + appVehicle.getVehicleCode() + " 导入成功");
} else if (isUpdateSupport) { } else if (isUpdateSupport) {
appVehicleMapper.updateAppVehicle(appVehicle); appVehicleMapper.updateAppVehicle(appVehicle);
successNum++; successNum++;
successMsg.append("<br/>" + successNum + "账号 " + appVehicle.getVehicleCode() + " 更新成功"); successMsg.append("<br/>" + successNum + "容器 " + appVehicle.getVehicleCode() + " 更新成功");
} else { } else {
failureNum++; failureNum++;
failureMsg.append("<br/>" + failureNum + "、容器 " + appVehicle.getVehicleCode() + " 已存在"); failureMsg.append("<br/>" + failureNum + "、容器 " + appVehicle.getVehicleCode() + " 已存在");

View File

@ -24,7 +24,7 @@
<select id="selectAppGoodsList" parameterType="AppGoods" resultMap="AppGoodsResult"> <select id="selectAppGoodsList" parameterType="AppGoods" resultMap="AppGoodsResult">
<include refid="selectAppGoodsVo"/> <include refid="selectAppGoodsVo"/>
<where> <where>
<if test="goodsId != null and goodsId != ''"> and goodsId like concat('%', #{goodsId}, '%')</if> <if test="goodsId != null and goodsId != ''"> and goods_id like concat('%', #{goodsId}, '%')</if>
<if test="goodsName != null and goodsName != ''"> and goods_name like concat('%', #{goodsName}, '%')</if> <if test="goodsName != null and goodsName != ''"> and goods_name like concat('%', #{goodsName}, '%')</if>
<if test="goodsUnit != null and goodsUnit != ''"> and goods_unit = #{goodsUnit}</if> <if test="goodsUnit != null and goodsUnit != ''"> and goods_unit = #{goodsUnit}</if>
<if test="goodsType != null and goodsType != ''"> and goods_type = #{goodsType}</if> <if test="goodsType != null and goodsType != ''"> and goods_type = #{goodsType}</if>
@ -35,11 +35,16 @@
</where> </where>
</select> </select>
<select id="selectAppGoodsByGoodsId" parameterType="String" resultMap="AppGoodsResult"> <select id="selectAppGoodsById" parameterType="String" resultMap="AppGoodsResult">
<include refid="selectAppGoodsVo"/> <include refid="selectAppGoodsVo"/>
where id = #{id} where id = #{id}
</select> </select>
<select id="selectAppGoodsByGoodsId" parameterType="String" resultMap="AppGoodsResult">
<include refid="selectAppGoodsVo"/>
where goods_id = #{goodsId}
</select>
<insert id="insertAppGoods" parameterType="AppGoods"> <insert id="insertAppGoods" parameterType="AppGoods">
insert into app_goods insert into app_goods
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
@ -84,18 +89,18 @@
where id = #{id} where id = #{id}
</update> </update>
<delete id="deleteAppGoodsByGoodsId" parameterType="String"> <delete id="deleteAppGoodsById" parameterType="String">
delete from app_goods where id = #{id} delete from app_goods where id = #{id}
</delete> </delete>
<delete id="deleteAppGoodsByGoodsIds" parameterType="String"> <delete id="deleteAppGoodsByIds" parameterType="String">
delete from app_goods where id in delete from app_goods where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{id} #{id}
</foreach> </foreach>
</delete> </delete>
<select id="selectAppGoodsListByGoodsIds" parameterType="String" resultMap="AppGoodsResult"> <select id="selectAppGoodsListByIds" parameterType="String" resultMap="AppGoodsResult">
<include refid="selectAppGoodsVo"/> <include refid="selectAppGoodsVo"/>
where id in where id in
<foreach item="id" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">

View File

@ -5,6 +5,7 @@
<mapper namespace="com.ruoyi.app.mapper.AppLocationMapper"> <mapper namespace="com.ruoyi.app.mapper.AppLocationMapper">
<resultMap type="AppLocation" id="AppLocationResult"> <resultMap type="AppLocation" id="AppLocationResult">
<result property="id" column="id"/>
<result property="locationId" column="location_id"/> <result property="locationId" column="location_id"/>
<result property="locationType" column="location_type"/> <result property="locationType" column="location_type"/>
<result property="locationStatus" column="location_status"/> <result property="locationStatus" column="location_status"/>
@ -24,7 +25,8 @@
</resultMap> </resultMap>
<sql id="selectAppLocationVo"> <sql id="selectAppLocationVo">
select location_id, select id,
location_id,
location_type, location_type,
location_status, location_status,
outer_id, outer_id,
@ -46,6 +48,7 @@
<select id="selectAppLocationList" parameterType="AppLocation" resultMap="AppLocationResult"> <select id="selectAppLocationList" parameterType="AppLocation" resultMap="AppLocationResult">
<include refid="selectAppLocationVo"/> <include refid="selectAppLocationVo"/>
<where> <where>
<if test="locationId != null ">and location_id = #{locationId}</if>
<if test="locationType != null ">and location_type = #{locationType}</if> <if test="locationType != null ">and location_type = #{locationType}</if>
<if test="locationStatus != null ">and location_status = #{locationStatus}</if> <if test="locationStatus != null ">and location_status = #{locationStatus}</if>
<if test="outerId != null and outerId != ''">and outer_id = #{outerId}</if> <if test="outerId != null and outerId != ''">and outer_id = #{outerId}</if>
@ -63,6 +66,10 @@
</where> </where>
</select> </select>
<select id="selectAppLocationById" parameterType="String" resultMap="AppLocationResult">
<include refid="selectAppLocationVo"/>
where id = #{id}
</select>
<select id="selectAppLocationByLocationId" parameterType="String" resultMap="AppLocationResult"> <select id="selectAppLocationByLocationId" parameterType="String" resultMap="AppLocationResult">
<include refid="selectAppLocationVo"/> <include refid="selectAppLocationVo"/>
where location_id = #{locationId} where location_id = #{locationId}
@ -86,6 +93,7 @@
<insert id="insertAppLocation" parameterType="AppLocation"> <insert id="insertAppLocation" parameterType="AppLocation">
insert into app_location insert into app_location
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">
<if test="id != null">id,</if>
<if test="locationId != null">location_id,</if> <if test="locationId != null">location_id,</if>
<if test="locationType != null">location_type,</if> <if test="locationType != null">location_type,</if>
<if test="locationStatus != null">location_status,</if> <if test="locationStatus != null">location_status,</if>
@ -104,6 +112,7 @@
<if test="isEnable != null">is_enable,</if> <if test="isEnable != null">is_enable,</if>
</trim> </trim>
<trim prefix="values (" suffix=")" suffixOverrides=","> <trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null">#{id},</if>
<if test="locationId != null">#{locationId},</if> <if test="locationId != null">#{locationId},</if>
<if test="locationType != null">#{locationType},</if> <if test="locationType != null">#{locationType},</if>
<if test="locationStatus != null">#{locationStatus},</if> <if test="locationStatus != null">#{locationStatus},</if>
@ -128,6 +137,7 @@
insert into app_location insert into app_location
( (
<trim prefixOverrides="," suffixOverrides=","> <trim prefixOverrides="," suffixOverrides=",">
<if test="location.id != null">id,</if>
<if test="location.locationId != null">location_id,</if> <if test="location.locationId != null">location_id,</if>
<if test="location.locationType != null">location_type,</if> <if test="location.locationType != null">location_type,</if>
<if test="location.locationStatus != null">location_status,</if> <if test="location.locationStatus != null">location_status,</if>
@ -149,6 +159,7 @@
values values
( (
<trim prefixOverrides="," suffixOverrides=","> <trim prefixOverrides="," suffixOverrides=",">
<if test="location.id != null">#{location.id},</if>
<if test="location.locationId != null">#{location.locationId},</if> <if test="location.locationId != null">#{location.locationId},</if>
<if test="location.locationType != null">#{location.locationType},</if> <if test="location.locationType != null">#{location.locationType},</if>
<if test="location.locationStatus != null">#{location.locationStatus},</if> <if test="location.locationStatus != null">#{location.locationStatus},</if>
@ -173,6 +184,7 @@
<update id="updateAppLocation" parameterType="AppLocation"> <update id="updateAppLocation" parameterType="AppLocation">
update app_location update app_location
<trim prefix="SET" suffixOverrides=","> <trim prefix="SET" suffixOverrides=",">
<if test="locationId != null">location_id = #{locationId},</if>
<if test="locationType != null">location_type = #{locationType},</if> <if test="locationType != null">location_type = #{locationType},</if>
<if test="locationStatus != null">location_status = #{locationStatus},</if> <if test="locationStatus != null">location_status = #{locationStatus},</if>
<if test="outerId != null">outer_id = #{outerId},</if> <if test="outerId != null">outer_id = #{outerId},</if>
@ -189,27 +201,27 @@
<if test="isWorking != null">is_working = #{isWorking},</if> <if test="isWorking != null">is_working = #{isWorking},</if>
<if test="isEnable != null">is_enable = #{isEnable},</if> <if test="isEnable != null">is_enable = #{isEnable},</if>
</trim> </trim>
where location_id = #{locationId} where id = #{id}
</update> </update>
<delete id="deleteAppLocationByLocationId" parameterType="String"> <delete id="deleteAppLocationById" parameterType="String">
delete delete
from app_location from app_location
where location_id = #{locationId} where id = #{id}
</delete> </delete>
<delete id="deleteAppLocationByLocationIds" parameterType="String"> <delete id="deleteAppLocationByIds" parameterType="Long">
delete from app_location where location_id in delete from app_location where id in
<foreach item="locationId" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{locationId} #{id}
</foreach> </foreach>
</delete> </delete>
<select id="selectAppLocationListByLocationIds" parameterType="String" resultMap="AppLocationResult"> <select id="selectAppLocationListByIds" parameterType="String" resultMap="AppLocationResult">
<include refid="selectAppLocationVo"/> <include refid="selectAppLocationVo"/>
where location_id in where id in
<foreach item="locationId" collection="array" open="(" separator="," close=")"> <foreach item="id" collection="array" open="(" separator="," close=")">
#{locationId} #{id}
</foreach> </foreach>
</select> </select>
</mapper> </mapper>

View File

@ -37,6 +37,10 @@
<include refid="selectAppStandVo"/> <include refid="selectAppStandVo"/>
where stand_id = #{standId} where stand_id = #{standId}
</select> </select>
<select id="selectAppStandByStandCode" parameterType="String" resultMap="AppStandResult">
<include refid="selectAppStandVo"/>
where stand_code = #{standCode}
</select>
<insert id="insertAppStand" parameterType="AppStand"> <insert id="insertAppStand" parameterType="AppStand">
insert into app_stand insert into app_stand

View File

@ -51,6 +51,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where id = #{id} where id = #{id}
</select> </select>
<select id="selectAppStorageByStorageId" parameterType="String" resultMap="AppStorageResult">
<include refid="selectAppStorageVo"/>
where storage_id = #{storageId}
</select>
<insert id="insertAppStorage" parameterType="AppStorage" useGeneratedKeys="true" keyProperty="id"> <insert id="insertAppStorage" parameterType="AppStorage" useGeneratedKeys="true" keyProperty="id">
insert into app_storage insert into app_storage
<trim prefix="(" suffix=")" suffixOverrides=","> <trim prefix="(" suffix=")" suffixOverrides=",">