diff --git a/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationService.java b/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationService.java index 2f3f432..3868091 100644 --- a/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationService.java +++ b/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationService.java @@ -6,7 +6,7 @@ import java.util.List; public interface LocationAllocationService { - String allocation(String locationRule, String roadWay, String warehouseCode, String containerCode, Integer materialAreas); + String allocation(int locationRule, List<String> locationTypeCodeList, int high, String destination, String warehouseCode, String containerCode, String materialAreaCode); } diff --git a/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationServiceImpl.java b/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationServiceImpl.java index c07d46b..729bfde 100644 --- a/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationServiceImpl.java +++ b/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/LocationAllocationServiceImpl.java @@ -22,6 +22,8 @@ import java.util.ArrayList; import java.util.List; import java.util.stream.Collectors; +import static java.util.stream.Collectors.toList; + @Service public class LocationAllocationServiceImpl implements LocationAllocationService { @@ -37,18 +39,17 @@ public class LocationAllocationServiceImpl implements LocationAllocationService private TaskHeaderService taskHeaderService; @Override - public String allocation(String locationRule, String area, String warehouseCode, String containerCode, Integer materialAreas) { - if (StringUtils.isEmpty(locationRule)) { - return null; - } + public String allocation(int locationRule, List<String> locationTypeCodeList, int high, String area, String warehouseCode, String containerCode, String materialAreaCode) { LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); containerLambdaQueryWrapper.eq(Container::getCode, containerCode) .eq(Container::getWarehouseCode, warehouseCode); Container container = containerService.getOne(containerLambdaQueryWrapper); + LambdaQueryWrapper<ContainerType> containerTypeLambdaQueryWrapper = Wrappers.lambdaQuery(); containerTypeLambdaQueryWrapper.eq(ContainerType::getCode, container.getContainerType()) .eq(ContainerType::getWarehouseCode, warehouseCode); ContainerType containerType = containerTypeService.getOne(containerTypeLambdaQueryWrapper); + String locationType = containerType.getLocationType(); List<LocationType> locationTypeList = new ArrayList<>(); String[] list = locationType.split(","); @@ -59,52 +60,42 @@ public class LocationAllocationServiceImpl implements LocationAllocationService LocationType locationType1 = locationTypeService.getOne(locationTypeLambdaQueryWrapper); locationTypeList.add(locationType1); } - if(area == null) { - String locationTypeCode = locationTypeList.get(0).getCode(); - LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery(); - locationLambdaQueryWrapper.eq(Location::getLocationType, locationTypeCode) - .eq(Location::getDeleted, 0); - List<Location> locations = locationService.list(locationLambdaQueryWrapper); - Location location = locations.get(0); - area = location.getArea(); - } + List<String> locationTypeCodes = locationTypeList.stream(). + map(t -> t.getCode()).collect(toList()); + List<String> mergelocationTypeCodeList = locationTypeCodeList.stream().filter(item -> locationTypeCodes.contains(item)).collect(toList()); switch (locationRule) { - case Constants.DOUBLE_RK: - return doubleRk(area, warehouseCode, locationTypeList, materialAreas); - case Constants.SINGER_RK: - return singleRk(area, warehouseCode, locationTypeList, materialAreas); + case QuantityConstant.DOUBLE_FORK: + return doubleRk(area, high, warehouseCode, mergelocationTypeCodeList, materialAreaCode); + case QuantityConstant.SINGLE_FORK: + return singleRk(area, high, warehouseCode, mergelocationTypeCodeList, materialAreaCode); } return null; } - /* + /** * 双伸位库位入库分配库位 */ - private String doubleRk(String area, String warehouseCode, List<LocationType> locationTypeList, Integer materialAreas) { + private String doubleRk(String area, int high, String warehouseCode, List<String> locationTypeCodeList, String materialAreaCode) { LambdaQueryWrapper<Location> locationLambda = Wrappers.lambdaQuery(); locationLambda.eq(Location::getArea, area). eq(Location::getWarehouseCode, warehouseCode) .eq(Location::getStatus, QuantityConstant.STATUS_LOCATION_EMPTY) - .eq(Location::getRowFlag, 1) + .eq(Location::getHigh, high) + .eq(StringUtils.isNotEmpty(materialAreaCode), Location::getMaterialAreaCode, materialAreaCode) + .eq(Location::getRowFlag, QuantityConstant.ROW_OUT) .eq(Location::getContainerCode, ""); List<Location> locationList = locationService.list(locationLambda); List<Location> removeLocaationList = new ArrayList<>(); - for (Location location1 : locationList) { - if (taskHeaderService.getUncompleteTaskInNear(location1) > 0) { - removeLocaationList.add(location1); - } - Integer areas = location1.getMaterialAreas(); - if(areas.intValue() != materialAreas.intValue()) { - removeLocaationList.add(location1); - } - } locationList.removeAll(removeLocaationList); + if (locationList == null || locationList.size() == 0) { locationLambda = Wrappers.lambdaQuery(); locationLambda.eq(Location::getArea, area). eq(Location::getWarehouseCode, warehouseCode) .eq(Location::getStatus, QuantityConstant.STATUS_LOCATION_EMPTY) - .eq(Location::getRowFlag, 0) + .eq(Location::getHigh, high) + .eq(StringUtils.isNotEmpty(materialAreaCode), Location::getMaterialAreaCode, materialAreaCode) + .eq(Location::getRowFlag, QuantityConstant.ROW_IN) .eq(Location::getContainerCode, ""); locationList = locationService.list(locationLambda); removeLocaationList = new ArrayList<>(); @@ -115,39 +106,36 @@ public class LocationAllocationServiceImpl implements LocationAllocationService } locationList.removeAll(removeLocaationList); } - String locationCode = filter(locationList, locationTypeList, area); + Location location = locationList.stream().findFirst().orElse(null); + String locationCode = location.getCode(); return locationCode; } - /* + /** * 单伸位库位入库分配库位 */ - private String singleRk(String area, String warehouseCode, List<LocationType> locationTypeList, Integer materialAreas) { + private String singleRk(String area, int high, String warehouseCode, List<String> locationTypeCodeList, String materialAreaCode) { LambdaQueryWrapper<Location> locationLambda = Wrappers.lambdaQuery(); locationLambda.eq(Location::getArea, area). eq(Location::getWarehouseCode, warehouseCode) .eq(Location::getStatus, QuantityConstant.STATUS_LOCATION_EMPTY) + .eq(Location::getHigh, high) + .eq(StringUtils.isNotEmpty(materialAreaCode), Location::getMaterialAreaCode, materialAreaCode) + .in(Location::getLocationType, locationTypeCodeList) .eq(Location::getContainerCode, ""); List<Location> locationList = locationService.list(locationLambda); - List<Location> removeLocaationList = new ArrayList<>(); - for (Location location1 : locationList) { - Integer areas = location1.getMaterialAreas(); - if(areas.intValue() != materialAreas.intValue()) { - removeLocaationList.add(location1); - } - } - locationList.removeAll(removeLocaationList); - String locationCode = filter(locationList, locationTypeList, area); + + Location location = locationList.stream().findFirst().orElse(null); + String locationCode = location.getCode(); return locationCode; } - private String filter(List<Location> locationList, List<LocationType> locationTypeList, String area) { - List<String> codeList = locationTypeList.stream().map(t -> t.getCode()).collect(Collectors.toList()); - List<Location> newLocation = locationList.stream().filter(t -> codeList.contains(t.getLocationType()) && t.getArea().equals(area)).collect(Collectors.toList()); - if (newLocation.isEmpty()) { - return null; - } else { - return newLocation.get(0).getCode(); - } - } +// private String filter(List<Location> locationList, List<String> locationTypeList, String area) { +// List<Location> newLocation = locationList.stream().filter(t -> locationTypeList.contains(t.getLocationType()) && t.getArea().equals(area)).collect(toList()); +// if (newLocation.isEmpty()) { +// return null; +// } else { +// return newLocation.get(0).getCode(); +// } +// } } diff --git a/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/WarecellAllocationServiceImpl.java b/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/WarecellAllocationServiceImpl.java index b4d2028..e229c09 100644 --- a/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/WarecellAllocationServiceImpl.java +++ b/src/main/java/com/huaheng/api/wcs/service/warecellAllocation/WarecellAllocationServiceImpl.java @@ -9,6 +9,7 @@ import com.huaheng.common.support.Convert; import com.huaheng.common.utils.StringUtils; import com.huaheng.common.utils.security.ShiroUtils; import com.huaheng.framework.web.domain.AjaxResult; +import com.huaheng.framework.web.service.ConfigService; import com.huaheng.pc.config.FilterConfigDetail.domain.FilterConfigDetail; import com.huaheng.pc.config.FilterConfigDetail.service.FilterConfigDetailService; import com.huaheng.pc.config.configValue.domain.ConfigValue; @@ -19,6 +20,8 @@ import com.huaheng.pc.config.containerType.domain.ContainerType; import com.huaheng.pc.config.containerType.service.ContainerTypeService; import com.huaheng.pc.config.location.domain.Location; import com.huaheng.pc.config.location.service.LocationService; +import com.huaheng.pc.config.locationHigh.domain.LocationHigh; +import com.huaheng.pc.config.locationHigh.service.LocationHighService; import com.huaheng.pc.config.locationType.domain.LocationType; import com.huaheng.pc.config.locationType.service.LocationTypeService; import com.huaheng.pc.config.material.domain.Material; @@ -27,6 +30,8 @@ import com.huaheng.pc.config.materialType.domain.MaterialType; import com.huaheng.pc.config.materialType.service.MaterialTypeService; import com.huaheng.pc.config.receiptPreference.domain.ReceiptPreference; import com.huaheng.pc.config.receiptPreference.service.ReceiptPreferenceService; +import com.huaheng.pc.config.zone.domain.Zone; +import com.huaheng.pc.config.zone.service.ZoneService; import com.huaheng.pc.receipt.receiptContainerDetail.domain.ReceiptContainerDetail; import com.huaheng.pc.receipt.receiptContainerDetail.service.ReceiptContainerDetailService; import com.huaheng.pc.receipt.receiptContainerHeader.domain.ReceiptContainerHeader; @@ -59,6 +64,8 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService @Resource private ContainerTypeService containerTypeService; @Resource + private ConfigService configService; + @Resource private ConfigValueService configValueService; @Resource private ReceiptPreferenceService receiptPreferenceService; @@ -84,6 +91,10 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService private TransferTaskService transferTaskService; @Resource private LocationAllocationService locationAllocationService; + @Resource + private ZoneService zoneService; + @Resource + private LocationHighService locationHighService; /** * 立库仓位分配 @@ -113,72 +124,74 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService if (StringUtils.isNull(wcsTask.getHeight())) { return AjaxResult.error("高为空"); } - if (StringUtils.isNull(wcsTask.getWeight())) { - return AjaxResult.error("重为空"); - } +// if (StringUtils.isNull(wcsTask.getWeight())) { +// return AjaxResult.error("重为空"); +// } return verticalWarehouseAllocation(wcsTask); } public AjaxResult verticalWarehouseAllocation(WcsTask wcsTask) { String warehouseCode = wcsTask.getWarehouseCode(); + String destination = wcsTask.getDestination(); + String locationCode = null; + String height = wcsTask.getHeight(); + if(height == null) { + return AjaxResult.error("分配库位时,高度为空"); + } + LambdaQueryWrapper<Zone> zoneLambdaQueryWrapper = Wrappers.lambdaQuery(); + zoneLambdaQueryWrapper.eq(Zone::getArea, destination); + Zone zone = zoneService.getOne(zoneLambdaQueryWrapper); + if(zone == null) { + return AjaxResult.error("分配库位时,没有找到库区"); + } //查询满足条件的库位类型 LambdaQueryWrapper<LocationType> lambdaQueryWrapper = Wrappers.lambdaQuery(); - lambdaQueryWrapper.gt(LocationType::getLength, wcsTask.getLength()) - .gt(LocationType::getWidth, wcsTask.getWidth()) - .gt(LocationType::getHeight, wcsTask.getHeight()) - .gt(LocationType::getMaxWeight, wcsTask.getWidth()) + lambdaQueryWrapper.eq(LocationType::getZoneCode, zone.getCode()) .eq(LocationType::getWarehouseCode, warehouseCode); List<LocationType> locationTypeList = locationTypeService.list(lambdaQueryWrapper); - - String locationCode = null; + if(locationTypeList == null) { + return AjaxResult.error("分配库位时,没有找到库位类型"); + } + List<String> locationTypeCodeList = locationTypeList.stream(). + map(t -> t.getCode()).collect(Collectors.toList()); + LambdaQueryWrapper<LocationHigh> locationHighLambdaQueryWrapper = Wrappers.lambdaQuery(); + locationHighLambdaQueryWrapper.eq(LocationHigh::getHighLevel, Integer.parseInt(height)) + .in(LocationHigh::getLocationTypeCode, locationTypeCodeList); + LocationHigh locationHigh = locationHighService.getOne(locationHighLambdaQueryWrapper); + int high = locationHigh.getHigh(); + TaskHeader taskHeader = taskHeaderService.getById(wcsTask.getTaskNo()); + if (taskHeader.getStatus() == QuantityConstant.TASK_STATUS_COMPLETED) { + return AjaxResult.error("任务已经完成,不能再分库位"); + } //查询任务明细 LambdaQueryWrapper<TaskDetail> taskDetailLambda = Wrappers.lambdaQuery(); taskDetailLambda.eq(TaskDetail::getTaskId, wcsTask.getTaskNo()); List<TaskDetail> taskDetailList = taskDetailService.list(taskDetailLambda); - - TaskHeader taskHeader = taskHeaderService.getById(wcsTask.getTaskNo()); - if (taskHeader.getStatus() == 100) { - return AjaxResult.error("任务已经完成,不能再分库位"); - } String containerCode = taskHeader.getContainerCode(); - + String value = configService.getKey(QuantityConstant.RULE_ALLOCATION); + if (StringUtils.isEmpty(value)) { + return AjaxResult.error("未绑定定位规则"); + } + int allocationRule = Integer.parseInt(value); + String materialAreaCode = null; /* 循环查询入库组盘明细*/ List<ReceiptContainerDetail> receiptContainerDetailList = new ArrayList<>(); for (TaskDetail taskDetail : taskDetailList) { - ReceiptContainerDetail receiptContainerDetail = receiptContainerDetailService.getById(taskDetail.getAllocationId()); + ReceiptContainerDetail receiptContainerDetail = receiptContainerDetailService. + getById(taskDetail.getAllocationId()); if (receiptContainerDetail != null) { receiptContainerDetailList.add(receiptContainerDetail); } } //去重 receiptContainerDetailList = receiptContainerDetailList.stream().distinct().collect(Collectors.toList()); - - String locatingRule = null; - ReceiptContainerHeader receiptContainerHeader = null; - if (StringUtils.isEmpty(locatingRule)) { - //物料类别中定位规则为空时,查询入库首选项 - LambdaQueryWrapper<ConfigValue> configValueLambda = Wrappers.lambdaQuery(); - configValueLambda.eq(ConfigValue::getWarehouseCode, warehouseCode) - .eq(ConfigValue::getModuleType, "receipt") - .eq(ConfigValue::getRecordType, "入库首选项"); - ConfigValue configValue = configValueService.getOne(configValueLambda); - LambdaQueryWrapper<ReceiptPreference> receiptPreferenceLambda = Wrappers.lambdaQuery(); - receiptPreferenceLambda.eq(ReceiptPreference::getCode, configValue.getValue()) - .eq(ReceiptPreference::getWarehouseCode, warehouseCode); - ReceiptPreference receiptPreference = receiptPreferenceService.getOne(receiptPreferenceLambda); - locatingRule = receiptPreference.getLocationRule(); - } - - if (StringUtils.isEmpty(locatingRule)){ - throw new ServiceException("未绑定定位规则"); - } - Integer materialAreas = 0; if(receiptContainerDetailList != null && receiptContainerDetailList.size() > 0) { String materialCode = receiptContainerDetailList.get(0).getMaterialCode(); Material material = materialService.findAllByCode(materialCode, warehouseCode); - materialAreas = material.getMaterialAreas(); + materialAreaCode = material.getMaterialAreaCode(); } - locationCode = locationAllocationService.allocation(locatingRule, wcsTask.getDestination(), warehouseCode, containerCode, materialAreas); + locationCode = locationAllocationService.allocation(allocationRule, + locationTypeCodeList, high, destination, warehouseCode, containerCode, materialAreaCode); if (StringUtils.isEmpty(locationCode)) { return AjaxResult.error("没有库位可分配"); } @@ -195,7 +208,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService //更新库位编码到组盘头表 ReceiptContainerDetail receiptContainerDetail = receiptContainerDetailList.get(0); if (receiptContainerDetail != null) { - receiptContainerHeader = receiptContainerHeaderService.getById(receiptContainerDetail.getReceiptContainerId()); + ReceiptContainerHeader receiptContainerHeader = receiptContainerHeaderService.getById(receiptContainerDetail.getReceiptContainerId()); receiptContainerHeader.setToLocation(locationCode); if (!receiptContainerHeaderService.updateById(receiptContainerHeader)) { throw new ServiceException("更新库位失败"); @@ -227,7 +240,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService int rowFlag = location.getRowFlag().intValue(); Integer preTaskNo = 0; //如果是外侧库位,那么就要判断该库位对应的内侧库位是不是有托盘 - if (rowFlag == 1) { + if (rowFlag == QuantityConstant.ROW_OUT) { Location insideLocation = locationService.getInsideNear(location); if (StringUtils.isNotEmpty(insideLocation.getContainerCode())) { Location destinationLocation = locationService.getEmptyLocation(insideLocation); @@ -241,6 +254,7 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService } taskHeader.setZoneCode(location.getZoneCode()); taskHeader.setPreTaskNo(preTaskNo); + taskHeader.setWeight(wcsTask.getWeight()); taskHeader.setToLocation(locationCode); if (!taskHeaderService.updateById(taskHeader)) { throw new ServiceException("更新任务头表目标库位失败"); @@ -318,9 +332,9 @@ public class WarecellAllocationServiceImpl implements WarecellAllocationService if (StringUtils.isNull(wcsTask.getHeight())) { return AjaxResult.error("高为空"); } - if (StringUtils.isNull(wcsTask.getWeight())) { - return AjaxResult.error("重为空"); - } +// if (StringUtils.isNull(wcsTask.getWeight())) { +// return AjaxResult.error("重为空"); +// } //查询满足条件的库位类型 LambdaQueryWrapper<LocationType> lambdaQueryWrapper = Wrappers.lambdaQuery(); diff --git a/src/main/java/com/huaheng/common/constant/QuantityConstant.java b/src/main/java/com/huaheng/common/constant/QuantityConstant.java index 0e5fd19..f3b980f 100644 --- a/src/main/java/com/huaheng/common/constant/QuantityConstant.java +++ b/src/main/java/com/huaheng/common/constant/QuantityConstant.java @@ -391,6 +391,10 @@ public class QuantityConstant { public static final String RULE_SHIPMENT_TASK= "shipmentTaskRule"; public static final String RULE_TASK_LOCATION = "taskLocationRule"; public static final String RULE_CONNECT_WCS = "connectWcs"; + public static final String RULE_ALLOCATION = "allocationRule"; + + public static final int DOUBLE_FORK = 1; + public static final int SINGLE_FORK = 0; public static final int RULE_TASK_SET_LOCATION = 1; public static final int RULE_TASK_NOT_LOCATION = 0; @@ -401,6 +405,8 @@ public class QuantityConstant { public static final int RULE_WCS_CONNECT = 1; public static final int RULE_WCS_DISCONNECT = 0; + public static final int NOT_MATERIAL_AREAS = 0; + public static final int RYTASK_STATUS_RUN = 0; public static final int RYTASK_STATUS_STOP = 1; diff --git a/src/main/java/com/huaheng/pc/config/company/controller/CompanyController.java b/src/main/java/com/huaheng/pc/config/company/controller/CompanyController.java index 759d313..c114530 100644 --- a/src/main/java/com/huaheng/pc/config/company/controller/CompanyController.java +++ b/src/main/java/com/huaheng/pc/config/company/controller/CompanyController.java @@ -67,7 +67,7 @@ public class CompanyController extends BaseController { .eq(Company::getDeleted,false) .orderByDesc(Company::getId); - if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){ + if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)) { /** * 使用分页查询 */ diff --git a/src/main/java/com/huaheng/pc/config/location/domain/Location.java b/src/main/java/com/huaheng/pc/config/location/domain/Location.java index b73eacd..4847a03 100644 --- a/src/main/java/com/huaheng/pc/config/location/domain/Location.java +++ b/src/main/java/com/huaheng/pc/config/location/domain/Location.java @@ -99,8 +99,8 @@ public class Location implements Serializable { /** * 物料分区 */ - @TableField(value = "materialAreas") - private Integer materialAreas; + @TableField(value = "materialAreaCode") + private String materialAreaCode; /** * 名称 diff --git a/src/main/java/com/huaheng/pc/config/location/service/LocationServiceImpl.java b/src/main/java/com/huaheng/pc/config/location/service/LocationServiceImpl.java index d1a0134..80f867f 100644 --- a/src/main/java/com/huaheng/pc/config/location/service/LocationServiceImpl.java +++ b/src/main/java/com/huaheng/pc/config/location/service/LocationServiceImpl.java @@ -520,6 +520,7 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i LambdaQueryWrapper<Location> queryWrapper = Wrappers.lambdaQuery(); queryWrapper.eq(Location::getWarehouseCode, location.getWarehouseCode()); queryWrapper.eq(Location::getRoadway, location.getRoadway()); + queryWrapper.eq(Location::getHigh, location.getHigh()); queryWrapper.eq(Location::getRowFlag, QuantityConstant.ROW_OUT); queryWrapper.eq(Location::getContainerCode, ""); queryWrapper.eq(Location::getStatus, QuantityConstant.STATUS_LOCATION_EMPTY); @@ -564,6 +565,7 @@ public class LocationServiceImpl extends ServiceImpl<LocationMapper, Location> i queryWrapper.eq(Location::getWarehouseCode, location.getWarehouseCode()); queryWrapper.eq(Location::getRoadway, location.getRoadway()); queryWrapper.eq(Location::getRowFlag, QuantityConstant.ROW_OUT); + queryWrapper.eq(Location::getHigh, location.getHigh()); queryWrapper.eq(Location::getContainerCode, ""); queryWrapper.eq(Location::getStatus, QuantityConstant.STATUS_LOCATION_EMPTY); queryWrapper.eq(Location::getLocationType, location.getLocationType()); diff --git a/src/main/java/com/huaheng/pc/config/locationHigh/controller/LocationHighController.java b/src/main/java/com/huaheng/pc/config/locationHigh/controller/LocationHighController.java index 7caf443..3806e9b 100644 --- a/src/main/java/com/huaheng/pc/config/locationHigh/controller/LocationHighController.java +++ b/src/main/java/com/huaheng/pc/config/locationHigh/controller/LocationHighController.java @@ -82,7 +82,7 @@ public class LocationHighController extends BaseController if(StringUtils.isEmpty(locationHigh.getCode())) { return AjaxResult.error("库位类型为空"); } - + locationHigh.setWarehouseCode(ShiroUtils.getWarehouseCode()); return toAjax(locationHighService.save(locationHigh)); } diff --git a/src/main/java/com/huaheng/pc/config/locationHigh/domain/LocationHigh.java b/src/main/java/com/huaheng/pc/config/locationHigh/domain/LocationHigh.java index 63430bc..12121ff 100644 --- a/src/main/java/com/huaheng/pc/config/locationHigh/domain/LocationHigh.java +++ b/src/main/java/com/huaheng/pc/config/locationHigh/domain/LocationHigh.java @@ -35,11 +35,18 @@ public class LocationHigh implements Serializable { private String locationTypeCode; /** - * 高度值 + * 高低位 */ @TableField(value = "high") private Integer high; + + /** + * 高度值 + */ + @TableField(value = "highLevel") + private Integer highLevel; + /** * 顺序 */ diff --git a/src/main/java/com/huaheng/pc/config/material/controller/MaterialController.java b/src/main/java/com/huaheng/pc/config/material/controller/MaterialController.java index 18abe59..065ed74 100644 --- a/src/main/java/com/huaheng/pc/config/material/controller/MaterialController.java +++ b/src/main/java/com/huaheng/pc/config/material/controller/MaterialController.java @@ -20,6 +20,8 @@ import com.huaheng.framework.web.page.TableSupport; import com.huaheng.pc.common.JasperPrint.Print; import com.huaheng.pc.config.material.domain.Material; import com.huaheng.pc.config.material.service.MaterialService; +import com.huaheng.pc.config.materialArea.domain.MaterialArea; +import com.huaheng.pc.config.materialArea.service.MaterialAreaService; import com.huaheng.pc.inventory.inventoryDetail.domain.InventoryDetail; import com.huaheng.pc.inventory.inventoryDetail.service.InventoryDetailService; import io.swagger.annotations.Api; @@ -33,10 +35,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.sql.DataSource; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; +import java.util.*; @Api(tags = {"物料控制类"}) @Controller @@ -48,6 +47,8 @@ public class MaterialController extends BaseController { @Resource private MaterialService materialService; @Resource + private MaterialAreaService materialAreaService; + @Resource private InventoryDetailService inventoryDetailService; @Resource private DataSource dataSource; @@ -157,15 +158,23 @@ public class MaterialController extends BaseController { */ @ApiOperation(value = "批量修改物料", notes = "批量修改物料", httpMethod = "POST") @RequiresPermissions("config:material:edit") - @Log(title = "通用-物料管理", operating = "批量修改物料", action = BusinessType.UPDATE) + @Log(title = "基础数据-物料管理", operating = "批量修改物料", action = BusinessType.UPDATE) @PostMapping("/editBatchSave") @ResponseBody - public AjaxResult editBatchSave (String ids, String area) { - String[] idArray = Convert.toStrArray(ids); - LambdaUpdateWrapper<Material> wrapper = Wrappers.lambdaUpdate(); - wrapper.in(Material::getId, idArray) - .set(Material::getMaterialAreas, Integer.parseInt(area)); - return toAjax(materialService.update(wrapper)); + public AjaxResult editBatchSave (String ids, String materialAreaCode) { + if(StringUtils.isNotEmpty(materialAreaCode)) { + LambdaQueryWrapper<MaterialArea> materialAreaLambdaQueryWrapper = Wrappers.lambdaQuery(); + materialAreaLambdaQueryWrapper.eq(MaterialArea::getCode, materialAreaCode); + MaterialArea materialArea = materialAreaService.getOne(materialAreaLambdaQueryWrapper); + if (materialArea == null) { + return AjaxResult.error("没找到对应的物料区域"); + } + } + String[] idArray = Convert.toStrArray(ids); + LambdaUpdateWrapper<Material> wrapper = Wrappers.lambdaUpdate(); + wrapper.in(Material::getId, idArray) + .set(Material::getMaterialAreaCode, materialAreaCode); + return toAjax(materialService.update(wrapper)); } /** diff --git a/src/main/java/com/huaheng/pc/config/material/domain/Material.java b/src/main/java/com/huaheng/pc/config/material/domain/Material.java index 651f663..eac75ca 100644 --- a/src/main/java/com/huaheng/pc/config/material/domain/Material.java +++ b/src/main/java/com/huaheng/pc/config/material/domain/Material.java @@ -315,7 +315,7 @@ public class Material implements Serializable { /** * 物料分区 */ - @TableField(value = "materialAreas") - private Integer materialAreas; + @TableField(value = "materialAreaCode") + private String materialAreaCode; } \ No newline at end of file diff --git a/src/main/java/com/huaheng/pc/config/materialArea/controller/MaterialAreaController.java b/src/main/java/com/huaheng/pc/config/materialArea/controller/MaterialAreaController.java new file mode 100644 index 0000000..12687f6 --- /dev/null +++ b/src/main/java/com/huaheng/pc/config/materialArea/controller/MaterialAreaController.java @@ -0,0 +1,133 @@ +package com.huaheng.pc.config.materialArea.controller; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.huaheng.common.support.Convert; +import com.huaheng.common.utils.StringUtils; +import com.huaheng.common.utils.security.ShiroUtils; +import com.huaheng.framework.aspectj.lang.annotation.Log; +import com.huaheng.framework.aspectj.lang.constant.BusinessType; +import com.huaheng.framework.web.controller.BaseController; +import com.huaheng.framework.web.domain.AjaxResult; +import com.huaheng.framework.web.page.TableDataInfo; +import com.huaheng.pc.config.locationHigh.domain.LocationHigh; +import com.huaheng.pc.config.locationHigh.service.LocationHighService; +import com.huaheng.pc.config.materialArea.domain.MaterialArea; +import com.huaheng.pc.config.materialArea.service.MaterialAreaService; +import io.swagger.annotations.Api; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.*; + +import java.util.List; + +/** + * 物料分区 + * + * @author youjie + * @date 2021-08-24 + */ +@Api(tags = "物料分区") +@Controller +@RequestMapping("/config/materialArea") +public class MaterialAreaController extends BaseController +{ + private String prefix = "config/materialArea"; + + @Autowired + private MaterialAreaService materialAreaService; + + @GetMapping() + public String materialArea() + { + return prefix + "/materialArea"; + } + + /** + * 查询物料分区列表 + */ + @Log(title = "基础数据-物料分区", operating = "物料分区", action = BusinessType.GRANT) + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(MaterialArea materialArea, String createdBegin, String createdEnd) + { + LambdaQueryWrapper<MaterialArea> lambdaQueryWrapper = Wrappers.lambdaQuery(); + startPage(); + lambdaQueryWrapper.ge(StringUtils.isNotEmpty(createdBegin), MaterialArea::getCreated, createdBegin) + .le(StringUtils.isNotEmpty(createdEnd), MaterialArea::getCreated, createdEnd) + .eq(MaterialArea::getWarehouseCode, ShiroUtils.getWarehouseCode()) + .eq(StringUtils.isNotEmpty(materialArea.getCode()), MaterialArea::getCode, materialArea.getCode()) + .orderByAsc(MaterialArea::getId); + + List<MaterialArea> list = materialAreaService.list(lambdaQueryWrapper); + return getDataTable(list); + } + + /** + * 新增库位类型 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增物料分区 + */ + @Log(title = "基础数据-物料分区", operating = "新增物料分区", action = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(MaterialArea materialArea) + { + if(StringUtils.isEmpty(materialArea.getCode())) { + return AjaxResult.error("物料分区编码为空"); + } + materialArea.setWarehouseCode(ShiroUtils.getWarehouseCode()); + return toAjax(materialAreaService.save(materialArea)); + } + + /** + * 修改物料分区 + */ + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Integer id, ModelMap mmap) + { + MaterialArea materialArea = materialAreaService.getById(id); + mmap.put("materialArea", materialArea); + return prefix + "/edit"; + } + + + /** + * 修改物料分区 + */ + @Log(title = "基础数据-物料分区", operating = "修改物料分区", action = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(MaterialArea materialArea) + { + return toAjax(materialAreaService.saveOrUpdate(materialArea)); + } + + /** + * 删除物料分区 + */ + @Log(title = "基础数据-物料分区", operating = "修改物料分区", action = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + if (StringUtils.isEmpty(ids)) { + return AjaxResult.error("id不能为空"); + } + for (Integer id : Convert.toIntArray(ids)) + { + materialAreaService.removeById(id); + } + return AjaxResult.success("删除成功!"); + } + +} diff --git a/src/main/java/com/huaheng/pc/config/materialArea/domain/MaterialArea.java b/src/main/java/com/huaheng/pc/config/materialArea/domain/MaterialArea.java new file mode 100644 index 0000000..f18cd04 --- /dev/null +++ b/src/main/java/com/huaheng/pc/config/materialArea/domain/MaterialArea.java @@ -0,0 +1,50 @@ +package com.huaheng.pc.config.materialArea.domain; + +import com.baomidou.mybatisplus.annotation.*; +import lombok.Data; + +import java.io.Serializable; +import java.util.Date; + +@Data +@TableName(value = "material_area") +public class MaterialArea implements Serializable { + + /** + * 内部号 + */ + @TableId(value = "id", type = IdType.AUTO) + private Integer id; + + /** + * 仓库编码 + */ + @TableField(value = "warehouseCode") + private String warehouseCode; + + /** + * 编码 + */ + @TableField(value = "code") + private String code; + + + /** + * 名字 + */ + @TableField(value = "name") + private String name; + + /** + * 创建时间 + */ + @TableField(value = "created", fill = FieldFill.INSERT) + private Date created; + + /** + * 创建用户 + */ + @TableField(value = "createdBy", fill = FieldFill.INSERT) + private String createdBy; + +} \ No newline at end of file diff --git a/src/main/java/com/huaheng/pc/config/materialArea/mapper/MaterialAreaMapper.java b/src/main/java/com/huaheng/pc/config/materialArea/mapper/MaterialAreaMapper.java new file mode 100644 index 0000000..08afeee --- /dev/null +++ b/src/main/java/com/huaheng/pc/config/materialArea/mapper/MaterialAreaMapper.java @@ -0,0 +1,10 @@ +package com.huaheng.pc.config.materialArea.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huaheng.pc.config.locationHigh.domain.LocationHigh; +import com.huaheng.pc.config.locationType.domain.LocationType; +import com.huaheng.pc.config.materialArea.domain.MaterialArea; + +public interface MaterialAreaMapper extends BaseMapper<MaterialArea> { + +} \ No newline at end of file diff --git a/src/main/java/com/huaheng/pc/config/materialArea/service/MaterialAreaService.java b/src/main/java/com/huaheng/pc/config/materialArea/service/MaterialAreaService.java new file mode 100644 index 0000000..5f4441a --- /dev/null +++ b/src/main/java/com/huaheng/pc/config/materialArea/service/MaterialAreaService.java @@ -0,0 +1,14 @@ +package com.huaheng.pc.config.materialArea.service; + +import com.huaheng.pc.config.locationHigh.domain.LocationHigh; +import com.huaheng.pc.config.locationType.domain.LocationType; +import com.baomidou.mybatisplus.extension.service.IService; +import com.huaheng.pc.config.materialArea.domain.MaterialArea; + +import java.util.List; +import java.util.Map; + +public interface MaterialAreaService extends IService<MaterialArea>{ + + List<Map<String, Object>> queryCode(); +} diff --git a/src/main/java/com/huaheng/pc/config/materialArea/service/MaterialAreaServiceImpl.java b/src/main/java/com/huaheng/pc/config/materialArea/service/MaterialAreaServiceImpl.java new file mode 100644 index 0000000..b63c223 --- /dev/null +++ b/src/main/java/com/huaheng/pc/config/materialArea/service/MaterialAreaServiceImpl.java @@ -0,0 +1,30 @@ +package com.huaheng.pc.config.materialArea.service; + +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.huaheng.common.utils.security.ShiroUtils; +import com.huaheng.pc.config.locationHigh.domain.LocationHigh; +import com.huaheng.pc.config.locationHigh.mapper.LocationHighMapper; +import com.huaheng.pc.config.locationHigh.service.LocationHighService; +import com.huaheng.pc.config.materialArea.domain.MaterialArea; +import com.huaheng.pc.config.materialArea.mapper.MaterialAreaMapper; +import com.huaheng.pc.config.zone.domain.Zone; +import org.springframework.stereotype.Service; + +import java.util.List; +import java.util.Map; + +@Service("materialArea") +public class MaterialAreaServiceImpl extends ServiceImpl<MaterialAreaMapper, MaterialArea> implements MaterialAreaService { + + + @Override + public List<Map<String, Object>> queryCode() { + LambdaQueryWrapper<MaterialArea> lambda = Wrappers.lambdaQuery(); + lambda.select(MaterialArea::getCode, MaterialArea::getId, MaterialArea::getName) + .eq(MaterialArea::getWarehouseCode, ShiroUtils.getWarehouseCode()); + List<Map<String, Object>> mapList = this.listMaps(lambda); + return mapList; + } +} diff --git a/src/main/java/com/huaheng/pc/config/materialType/controller/MaterialTypeController.java b/src/main/java/com/huaheng/pc/config/materialType/controller/MaterialTypeController.java index a14427a..9199205 100644 --- a/src/main/java/com/huaheng/pc/config/materialType/controller/MaterialTypeController.java +++ b/src/main/java/com/huaheng/pc/config/materialType/controller/MaterialTypeController.java @@ -1,6 +1,7 @@ package com.huaheng.pc.config.materialType.controller; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; @@ -16,6 +17,8 @@ import com.huaheng.framework.web.page.TableDataInfo; import com.huaheng.framework.web.page.TableSupport; import com.huaheng.pc.config.material.domain.Material; import com.huaheng.pc.config.material.service.MaterialService; +import com.huaheng.pc.config.materialArea.domain.MaterialArea; +import com.huaheng.pc.config.materialArea.service.MaterialAreaService; import com.huaheng.pc.config.materialType.domain.MaterialType; import com.huaheng.pc.config.materialType.service.MaterialTypeService; import io.swagger.annotations.Api; @@ -38,6 +41,8 @@ public class MaterialTypeController extends BaseController { @Resource private MaterialTypeService materialTypeService; @Resource + private MaterialAreaService materialAreaService; + @Resource private MaterialService materialService; private String prefix = "config/materialType"; @@ -131,6 +136,39 @@ public class MaterialTypeController extends BaseController { } /** + * 修改物料 + */ + @GetMapping("/editBatch/{ids}") + public String editBatch (@PathVariable("ids") String ids, ModelMap mmap) { + mmap.put("ids", ids); + return prefix + "/editBatch"; + } + + /** + * 修改保存物料 + */ + @ApiOperation(value = "批量修改物料", notes = "批量修改物料", httpMethod = "POST") + @RequiresPermissions("config:material:edit") + @Log(title = "基础数据-物料管理", operating = "批量修改物料", action = BusinessType.UPDATE) + @PostMapping("/editBatchSave") + @ResponseBody + public AjaxResult editBatchSave (String ids, String materialAreaCode) { + if(StringUtils.isNotEmpty(materialAreaCode)) { + LambdaQueryWrapper<MaterialArea> materialAreaLambdaQueryWrapper = Wrappers.lambdaQuery(); + materialAreaLambdaQueryWrapper.eq(MaterialArea::getCode, materialAreaCode); + MaterialArea materialArea = materialAreaService.getOne(materialAreaLambdaQueryWrapper); + if (materialArea == null) { + return AjaxResult.error("没找到对应的物料区域"); + } + } + String[] idArray = Convert.toStrArray(ids); + LambdaUpdateWrapper<MaterialType> wrapper = Wrappers.lambdaUpdate(); + wrapper.in(MaterialType::getId, idArray) + .set(MaterialType::getMaterialAreaCode, materialAreaCode); + return toAjax(materialTypeService.update(wrapper)); + } + + /** * 删除物料类别 */ @RequiresPermissions("config:materialType:remove") diff --git a/src/main/java/com/huaheng/pc/config/materialType/domain/MaterialType.java b/src/main/java/com/huaheng/pc/config/materialType/domain/MaterialType.java index 30ac59b..92ba774 100644 --- a/src/main/java/com/huaheng/pc/config/materialType/domain/MaterialType.java +++ b/src/main/java/com/huaheng/pc/config/materialType/domain/MaterialType.java @@ -57,6 +57,12 @@ public class MaterialType implements Serializable { private String abcClass; /** + * 物料分区 + */ + @TableField(value = "materialAreaCode") + private String materialAreaCode; + + /** * 保质期(天) */ @TableField(value = "daysToExpire") diff --git a/src/main/java/com/huaheng/pc/config/zone/controller/ZoneController.java b/src/main/java/com/huaheng/pc/config/zone/controller/ZoneController.java index 28b6cd1..dc89751 100644 --- a/src/main/java/com/huaheng/pc/config/zone/controller/ZoneController.java +++ b/src/main/java/com/huaheng/pc/config/zone/controller/ZoneController.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.huaheng.common.constant.QuantityConstant; import com.huaheng.common.support.Convert; import com.huaheng.common.utils.StringUtils; import com.huaheng.common.utils.security.ShiroUtils; @@ -15,6 +16,7 @@ import com.huaheng.framework.web.page.PageDomain; import com.huaheng.framework.web.page.TableDataInfo; import com.huaheng.framework.web.page.TableSupport; import com.huaheng.pc.config.container.domain.Container; +import com.huaheng.pc.config.container.service.ContainerService; import com.huaheng.pc.config.location.domain.Location; import com.huaheng.pc.config.location.service.LocationService; import com.huaheng.pc.config.station.domain.Station; @@ -31,6 +33,7 @@ import java.util.ArrayList; import java.util.HashMap; import java.util.List; import java.util.Map; +import java.util.stream.Collectors; /** * 库区 信息操作处理 @@ -49,6 +52,8 @@ public class ZoneController extends BaseController { private ZoneService zoneService; @Resource private LocationService locationService; + @Resource + private ContainerService containerService; @RequiresPermissions("config:zone:view") @GetMapping() @@ -180,28 +185,38 @@ public class ZoneController extends BaseController { @GetMapping("/getStatus") @ResponseBody - public AjaxResult getStatus(String zoneCode){ + public AjaxResult getStatus(String zoneCode) { HashMap<String, Integer> map = new HashMap<>(); LambdaQueryWrapper<Location> queryWrapper = Wrappers.lambdaQuery(); queryWrapper.eq(Location::getZoneCode,zoneCode); List<Location> locationList = locationService.list(queryWrapper); - map.put("location",locationList.size()); + map.put("location", locationList.size()); queryWrapper = Wrappers.lambdaQuery(); queryWrapper.and(wrapper->wrapper.isNull(Location::getContainerCode).or().eq(Location::getContainerCode,"")) .eq(Location::getZoneCode,zoneCode); List<Location> emptyLocationList = locationService.list(queryWrapper); - map.put("emptyLocation",emptyLocationList.size()); - queryWrapper = Wrappers.lambdaQuery(); - queryWrapper.eq(Location::getZoneCode,zoneCode) - .eq(Location::getStatus,"empty") - .isNotNull(Location::getContainerCode) - .ne(Location::getContainerCode,""); - List<Location> haveContainLocation = locationService.list(queryWrapper); - map.put("haveContainLocation",haveContainLocation.size()); - queryWrapper = Wrappers.lambdaQuery(); - queryWrapper.eq(Location::getZoneCode,zoneCode) - .eq(Location::getStatus,"some"); - map.put("haveInventoryLocation",locationService.list(queryWrapper).size()); + map.put("emptyLocation", emptyLocationList.size()); + + LambdaQueryWrapper<Container> containerLambdaQueryWrapper2 = Wrappers.lambdaQuery(); + containerLambdaQueryWrapper2.eq(Container::getStatus, QuantityConstant.STATUS_CONTAINER_EMPTY); + List<Container> containerList2 = containerService.list(containerLambdaQueryWrapper2); + List<String> containerCodeList2 = containerList2.stream().map(Container::getCode).collect(Collectors.toList()); + LambdaQueryWrapper<Location> locationLambdaQueryWrapper2 = Wrappers.lambdaQuery(); + locationLambdaQueryWrapper2.in(Location::getContainerCode, containerCodeList2); + locationLambdaQueryWrapper2.eq(Location::getZoneCode, zoneCode); + List<Location> haveEmptyContainLocation = locationService.list(locationLambdaQueryWrapper2); + map.put("haveContainLocation", haveEmptyContainLocation.size()); + + LambdaQueryWrapper<Container> containerLambdaQueryWrapper = Wrappers.lambdaQuery(); + containerLambdaQueryWrapper.eq(Container::getStatus, QuantityConstant.STATUS_CONTAINER_SOME); + List<Container> containerList = containerService.list(containerLambdaQueryWrapper); + List<String> containerCodeList = containerList.stream().map(Container::getCode).collect(Collectors.toList()); + LambdaQueryWrapper<Location> locationLambdaQueryWrapper = Wrappers.lambdaQuery(); + locationLambdaQueryWrapper.in(Location::getContainerCode, containerCodeList); + locationLambdaQueryWrapper.eq(Location::getZoneCode, zoneCode); + List<Location> haveInventoryLocation = locationService.list(locationLambdaQueryWrapper); + map.put("haveInventoryLocation", haveInventoryLocation.size()); + return AjaxResult.success().setData(map); } } diff --git a/src/main/java/com/huaheng/pc/monitor/systemLog/controller/SystemLogController.java b/src/main/java/com/huaheng/pc/monitor/systemLog/controller/SystemLogController.java new file mode 100644 index 0000000..45ea10c --- /dev/null +++ b/src/main/java/com/huaheng/pc/monitor/systemLog/controller/SystemLogController.java @@ -0,0 +1,64 @@ +package com.huaheng.pc.monitor.systemLog.controller; + +import com.huaheng.common.exception.service.ServiceException; +import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Controller; +import org.springframework.ui.ModelMap; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.RequestMapping; + +import java.io.*; + +@Controller +@RequestMapping("/monitor/systemLog") +public class SystemLogController { + + /** + * 此处值应为日志所在路径 + */ +// @Value("${log.path}") +// private String path; + private String path = "D:\\company\\wms2\\WMSlog"; + private String prefix = "monitor/systemLog"; + + + @RequiresPermissions("monitor:systemLog:view") + @GetMapping("") + public String systemLog(ModelMap mmap){ + path = path + "\\"; + System.out.println("path路径为---"+path+"-----"); + File info = new File(path+"sys-info"); + File debug = new File(path+"sys-debug"); + File warn = new File(path+"sys-warn"); + File error = new File(path+"sys-error"); + mmap.put("infoNames",info.list()); + mmap.put("debugNames",debug.list()); + mmap.put("warnNames",warn.list()); + mmap.put("errorNames",error.list()); + return prefix+"/systemLog"; + } + + @GetMapping("/logview") + public String logview(String name,ModelMap mmap){ + String[] type = name.split("\\."); + String filePath = path+type[0]+"\\"+name; + StringBuilder stringBuilder = new StringBuilder(); + String len; + try { + BufferedReader bufferedReader = new BufferedReader(new FileReader(filePath)); + while ((len = bufferedReader.readLine())!=null){ + stringBuilder.append(len+"<br>\n"); + } + }catch (FileNotFoundException e){ + throw new ServiceException("找不到该文件"); + }catch (IOException e){ + throw new ServiceException("读取过程出现异常"); + }catch (Exception e){ + throw new ServiceException("未知的错误"); + } + mmap.put("log",stringBuilder.toString()); + return prefix + "/logview"; + } + +} diff --git a/src/main/java/com/huaheng/pc/receipt/receiving/service/ReceivingService.java b/src/main/java/com/huaheng/pc/receipt/receiving/service/ReceivingService.java index c8dfaf3..7828936 100644 --- a/src/main/java/com/huaheng/pc/receipt/receiving/service/ReceivingService.java +++ b/src/main/java/com/huaheng/pc/receipt/receiving/service/ReceivingService.java @@ -11,6 +11,7 @@ import com.huaheng.common.support.Convert; import com.huaheng.common.utils.StringUtils; import com.huaheng.common.utils.security.ShiroUtils; import com.huaheng.framework.web.domain.AjaxResult; +import com.huaheng.framework.web.service.ConfigService; import com.huaheng.pc.config.FilterConfigDetail.domain.FilterConfigDetail; import com.huaheng.pc.config.FilterConfigDetail.service.FilterConfigDetailService; import com.huaheng.pc.config.configValue.domain.ConfigValue; @@ -76,6 +77,8 @@ public class ReceivingService { @Resource private ContainerService containerService; @Resource + private ConfigService configService; + @Resource private TaskHeaderService taskHeaderService; @Resource private LocationTypeService locationTypeService; @@ -150,14 +153,14 @@ public class ReceivingService { } } - String locatingRule = this.findPositionRule(receiptContainerHeader, receiptContainerDetail); - //通过定位规则查找自定义sql - if (StringUtils.isEmpty(locatingRule)){ + String value = configService.getKey(QuantityConstant.RULE_ALLOCATION); + if (StringUtils.isEmpty(value)) { throw new ServiceException("未绑定定位规则"); } + int allocationRule = Integer.parseInt(value); Material material = materialService.findAllByCode(receiptContainerDetail.getMaterialCode()); - Integer materialAreas = material.getMaterialAreas(); - String locationCode = locationAllocationService.allocation(locatingRule, area, ShiroUtils.getWarehouseCode(),container.getCode(), materialAreas); + String materialAreaCode = material.getMaterialAreaCode(); + String locationCode = locationAllocationService.allocation(allocationRule, null, 0, area, ShiroUtils.getWarehouseCode(),container.getCode(), materialAreaCode); if (StringUtils.isNotEmpty(locationCode)){ locationService.updateStatus(locationCode, QuantityConstant.STATUS_LOCATION_LOCK); @@ -171,7 +174,7 @@ public class ReceivingService { int rowFlag = location.getRowFlag().intValue(); Integer preTaskNo = 0; //如果是外侧库位,那么就要判断该库位对应的内侧库位是不是有托盘 - if(rowFlag == 1) { + if(rowFlag == QuantityConstant.ROW_OUT) { Location insideLocation = locationService.getInsideNear(location); if(StringUtils.isNotEmpty(insideLocation.getContainerCode())) { Location destinationLocation = locationService.getEmptyLocation(insideLocation); diff --git a/src/main/java/com/huaheng/pc/task/taskHeader/service/ReceiptTaskService.java b/src/main/java/com/huaheng/pc/task/taskHeader/service/ReceiptTaskService.java index d729f93..b64278d 100644 --- a/src/main/java/com/huaheng/pc/task/taskHeader/service/ReceiptTaskService.java +++ b/src/main/java/com/huaheng/pc/task/taskHeader/service/ReceiptTaskService.java @@ -281,9 +281,9 @@ public class ReceiptTaskService { inventoryHeader.setLocationCode(task.getToLocation()); Location location = locationService.getLocationByCode(task.getToLocation(), ShiroUtils.getWarehouseCode()); inventoryHeader.setZoneCode(location.getZoneCode()); + inventoryHeader.setTotalWeight(task.getWeight()); inventoryHeader.setContainerCode(task.getContainerCode()); inventoryHeader.setContainerStatus(QuantityConstant.STATUS_CONTAINER_SOME); - inventoryHeader.setTotalWeight(task.getWeight()); inventoryHeader.setTotalQty(new BigDecimal(0)); inventoryHeader.setTotalLines(0); inventoryHeader.setLocking(1); diff --git a/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java b/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java index c46363e..56655bd 100644 --- a/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java +++ b/src/main/java/com/huaheng/pc/task/taskHeader/service/TaskHeaderServiceImpl.java @@ -375,11 +375,11 @@ public class TaskHeaderServiceImpl extends ServiceImpl<TaskHeaderMapper, TaskHea throw new ServiceException("任务" + taskIds[i] + "未找到,执行中止"); } //任务写入重量 - String weight = ""; - if (StringUtils.isNotNull(weightConvert)) { - weight = weightConvert[i]; - } - task.setWeight(weight); +// String weight = ""; +// if (StringUtils.isNotNull(weightConvert)) { +// weight = weightConvert[i]; +// } +// task.setWeight(weight); //如果已完成则不管 if (task.getStatus().equals(QuantityConstant.TASK_STATUS_COMPLETED)) { return AjaxResult.success("任务(" + taskIds[i] + ")任务已经是完成的!"); diff --git a/src/main/java/com/huaheng/pc/task/taskHeader/service/TransferTaskService.java b/src/main/java/com/huaheng/pc/task/taskHeader/service/TransferTaskService.java index 0145e89..fb22685 100644 --- a/src/main/java/com/huaheng/pc/task/taskHeader/service/TransferTaskService.java +++ b/src/main/java/com/huaheng/pc/task/taskHeader/service/TransferTaskService.java @@ -98,11 +98,15 @@ public class TransferTaskService { return AjaxResult.error("目标库位和源库位不在同一个巷道"); } + if(!sourceLocation.getHigh().equals(desLocation.getHigh())) { + return AjaxResult.error("目标库位和源库位高度不一样"); + } + if(!sourceLocation.getArea().equals(desLocation.getArea())) { return AjaxResult.error("目标库位和源库位不在同一个区域"); } - if(sourceLocation.getRowFlag() == 1) { + if(sourceLocation.getRowFlag() == QuantityConstant.ROW_OUT) { Location location1 = locationService.getNear(sourceLocation); //内侧库位 String locationCode = location1.getCode(); if(StringUtils.isNotEmpty(location1.getContainerCode())) { diff --git a/src/main/resources/application-druid.properties b/src/main/resources/application-druid.properties index 94faad1..976ad11 100644 --- a/src/main/resources/application-druid.properties +++ b/src/main/resources/application-druid.properties @@ -2,19 +2,26 @@ spring.datasource.type=com.alibaba.druid.pool.DruidDataSource spring.datasource.driverClassName=com.mysql.cj.jdbc.Driver # ���� -spring.datasource.druid.master.url=jdbc:mysql://localhost:3306/wms_v2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2b8 +#spring.datasource.druid.master.url=jdbc:mysql://172.16.29.45:3306/wms_v2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2b8 +spring.datasource.druid.master.url=jdbc:mysql://127.0.0.1:3306/wms_v2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2b8 #spring.datasource.druid.master.url=jdbc:mysql://172.16.29.45:3306/huahengExample?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false #spring.datasource.druid.master.url=jdbc:mysql://117.62.222.186:3306/wms_v2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2b8 #spring.datasource.druid.master.username=softhuaheng #spring.datasource.druid.master.password=HHrobot123. +#spring.datasource.druid.master.username=root +#spring.datasource.druid.master.password=hhsoftware spring.datasource.druid.master.username=root -spring.datasource.druid.master.password=hhsoftware +spring.datasource.druid.master.password=root # �ӿ� spring.datasource.druid.slave.open = false spring.datasource.druid.slave.url=jdbc:mysql://117.62.222.186:3306/wms_v2?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false -#spring.datasource.druid.master.username=softhuaheng -#spring.datasource.druid.master.password=HHrobot123. +#spring.datasource.druid.slave.username=softhuaheng +#spring.datasource.druid.slave.password=HHrobot123. +#WCS�� +spring.datasource.druid.wcs.url = jdbc:mysql://172.16.29.45:3306/huahengwcs3?useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&serverTimezone=GMT%2b8 +spring.datasource.druid.wcs.username=softhuaheng +spring.datasource.druid.wcs.password=HHrobot123. # ��ʼ������ spring.datasource.druid.initial-size=4 # ������ӳ�����,�Ե�ǰCPU������2 @@ -46,4 +53,4 @@ spring.datasource.druid.filter.wall.config.multi-statement-allow=true logging.level.com.huaheng=debug logging.level.org.springframework=warn logging.level.spring.springboot.dao=DEBUG - +logger.path=D:\\home\\WMSlog diff --git a/src/main/resources/application.yml b/src/main/resources/application.yml index 7a42e1d..2661828 100644 --- a/src/main/resources/application.yml +++ b/src/main/resources/application.yml @@ -189,3 +189,6 @@ gen: autoRemovePre: false # 表前缀(类名不会包含表前缀) gen.tablePrefix: sys_ +#系统日志地址 +log: + path: D:\home\WMSlog diff --git a/src/main/resources/logback.xml b/src/main/resources/logback.xml index 0d63c9c..c06423a 100644 --- a/src/main/resources/logback.xml +++ b/src/main/resources/logback.xml @@ -5,6 +5,7 @@ <property name="log.pattern" value="%d{yyyy-MM-dd HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n" /> <!--<appender name="ROLLING" class="ch.qos.logback.core.rolling.RollingFileAppender" />--> <property resource="application-druid.properties" /> +<!-- <property name="log.path" value="${logger.path}" />--> <property name="dataSource" value="${spring.datasource.type}" /> <property name="driverClassName" value="${spring.datasource.driverClassName}" /> <property name="url" value="${spring.datasource.druid.master.url}" /> @@ -186,4 +187,4 @@ each file should be at most 100MB, keep 60 days worth of history, but at most 20 <!--<logger name="sys-user" level="debug">--> <!--<appender-ref ref="sys-user"/>--> <!--</logger>--> -</configuration> \ No newline at end of file +</configuration> diff --git a/src/main/resources/static/huaheng/index.js b/src/main/resources/static/huaheng/index.js index 1d210bf..ead51b1 100644 --- a/src/main/resources/static/huaheng/index.js +++ b/src/main/resources/static/huaheng/index.js @@ -231,9 +231,9 @@ $(function () { $('.menuTabs .page-tabs-content').append(str); scrollToTab($('.menuTab.active')); } - // else { - // refreshTab(); - // } + else { + refreshTab(); + } return false; } diff --git a/src/main/resources/templates/config/locationHigh/add.html b/src/main/resources/templates/config/locationHigh/add.html index c2fec2e..bb5ac4e 100644 --- a/src/main/resources/templates/config/locationHigh/add.html +++ b/src/main/resources/templates/config/locationHigh/add.html @@ -12,6 +12,32 @@ </div> </div> <div class="form-group"> + <label class="col-sm-3 control-label">库位类型编码:</label> + <div class="col-sm-8"> + <input id="locationTypeCode" name="locationTypeCode" class="form-control" type="text"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">高度值:</label> + <div class="col-sm-8"> + <input id="highLevel" name="highLevel" class="form-control" type="text"> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">高低位:</label> + <div class="col-sm-8"> + <select id="high" name="high" class="form-control" th:with="high=${@dict.getType('high')}"> + <option th:each="item : ${high}" th:text="${item['dictLabel']}" th:value="${item['dictValue']}"></option> + </select> + </div> + </div> + <div class="form-group"> + <label class="col-sm-3 control-label">顺序:</label> + <div class="col-sm-8"> + <input id="sequence" name="sequence" class="form-control" type="text"> + </div> + </div> + <div class="form-group"> <div class="form-control-static col-sm-offset-9"> <button type="submit" class="btn btn-primary">提交</button> <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button> diff --git a/src/main/resources/templates/config/locationHigh/edit.html b/src/main/resources/templates/config/locationHigh/edit.html index 5a3c751..8ed32fa 100644 --- a/src/main/resources/templates/config/locationHigh/edit.html +++ b/src/main/resources/templates/config/locationHigh/edit.html @@ -4,155 +4,40 @@ <head th:include="include :: header"></head> <body class="white-bg"> <div class="wrapper wrapper-content animated fadeInRight ibox-content"> - <form class="form-horizontal m" id="form-locationType-edit" th:object="${locationType}"> + <form class="form-horizontal m" id="form-locationHigh-edit" th:object="${locationHigh}"> <input id="id" name="id" th:field="*{id}" type="hidden"> <div class="form-group"> - <label class="col-sm-3 control-label">区域:</label> - <div class="col-sm-8"> - <select id="zoneCode" name="zoneCode" class="form-control" th:with="zoneType=${@zone.getZoneCodeList()}"> - <option th:each="item : ${zoneType}" th:text="${item['name']}" th:value="${item['code']}"></option> - </select> - </div> - </div> - <div class="form-group"> <label class="col-sm-3 control-label">编码:</label> <div class="col-sm-8"> <input id="code" name="code" th:field="*{code}" class="form-control" type="text"> </div> </div> <div class="form-group"> - <label class="col-sm-3 control-label">库位类型名称:</label> - <div class="col-sm-8"> - <input id="name" name="name" th:field="*{name}" class="form-control" type="text"> - </div> - </div> - <div class="form-group"> - <label class="col-sm-3 control-label">长m:</label> - <div class="col-sm-8"> - <input id="length" name="length" th:field="*{length}" class="form-control" type="text"> - </div> - </div> - <div class="form-group"> - <label class="col-sm-3 control-label">宽m:</label> - <div class="col-sm-8"> - <input id="width" name="width" th:field="*{width}" class="form-control" type="text"> - </div> - </div> - <div class="form-group"> - <label class="col-sm-3 control-label">高m:</label> - <div class="col-sm-8"> - <input id="height" name="height" th:field="*{height}" class="form-control" type="text"> - </div> - </div> - <div class="form-group"> - <label class="col-sm-3 control-label">最大重量kg:</label> - <div class="col-sm-8"> - <input id="maxWeight" name="maxWeight" th:field="*{maxWeight}" class="form-control" type="text"> - </div> - </div> - <div class="form-group"> - <label class="col-sm-3 control-label">最小允许单位:</label> - <div class="col-sm-8"> - <input id="minQtyUm" name="minQtyUm" th:field="*{minQtyUm}" class="form-control" type="text"> - </div> - </div> - <div class="form-group"> - <label class="col-sm-3 control-label">校验位:</label> + <label class="col-sm-3 control-label">库位类型编码:</label> <div class="col-sm-8"> - <input id="checkDigit" name="checkDigit" th:field="*{checkDigit}" class="form-control" type="text"> + <input id="locationTypeCode" name="locationTypeCode" th:field="*{locationTypeCode}" class="form-control" type="text"> </div> </div> <div class="form-group"> - <label class="col-sm-3 control-label">最多混放物料数:</label> + <label class="col-sm-3 control-label">高度值:</label> <div class="col-sm-8"> - <input id="maxMaterials" name="maxMaterials" th:field="*{maxMaterials}" class="form-control" type="text"> + <input id="highLevel" name="highLevel" th:field="*{highLevel}" class="form-control" type="text"> </div> </div> <div class="form-group"> - <label class="col-sm-3 control-label">最大批号数量:</label> + <label class="col-sm-3 control-label">高低位:</label> <div class="col-sm-8"> - <input id="maxLots" name="maxLots" th:field="*{maxLots}" class="form-control" type="text"> + <select id="high" name="high" th:field="*{high}" class="form-control" th:with="high=${@dict.getType('high')}"> + <option th:each="item : ${high}" th:text="${item['dictLabel']}" th:value="${item['dictValue']}"></option> + </select> </div> </div> <div class="form-group"> - <label class="col-sm-3 control-label">最大允许托盘数:</label> - <div class="col-sm-8"> - <input id="maxContainers" name="maxContainers" th:field="*{maxContainers}" class="form-control" type="text"> - </div> - </div> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">创建时间:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="created" name="created" th:field="*{created}" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">创建者:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="createdBy" name="createdBy" th:field="*{createdBy}" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">创建时间:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="lastUpdated" name="lastUpdated" th:field="*{lastUpdated}" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">更新者:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="lastUpdatedBy" name="lastUpdatedBy" th:field="*{lastUpdatedBy}" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <div class="form-group"> - <label class="col-sm-3 control-label">是否有效:</label> + <label class="col-sm-3 control-label">顺序:</label> <div class="col-sm-8"> - <!--<input id="enable" name="enable" th:field="*{enable}" class="form-control" type="text">--> - <div class="onoffswitch"> - <input type="checkbox" th:checked="${locationType.enable}" class="onoffswitch-checkbox" id="enable" name="enable"> - <label class="onoffswitch-label" for="enable"> - <span class="onoffswitch-inner"></span> - <span class="onoffswitch-switch"></span> - </label> - </div> + <input id="sequence" name="sequence" th:field="*{sequence}" class="form-control" type="text"> </div> </div> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">是否删除:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="deleted" name="deleted" th:field="*{deleted}" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段1:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef1" name="userDef1" th:field="*{userDef1}" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段2:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef2" name="userDef2" th:field="*{userDef2}" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段3:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef3" name="userDef3" th:field="*{userDef3}" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段4:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef4" name="userDef4" th:field="*{userDef4}" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段5:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef5" name="userDef5" th:field="*{userDef5}" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> <div class="form-group"> <div class="form-control-static col-sm-offset-9"> <button type="submit" class="btn btn-primary">提交</button> @@ -163,16 +48,11 @@ </div> <div th:include="include::footer"></div> <script type="text/javascript"> - var prefix = ctx + "config/locationType"; - $("#form-locationType-edit").validate({ - rules:{ - xxxx:{ - required:true, - }, - }, + var prefix = ctx + "config/locationHigh"; + $("#form-locationHigh-edit").validate({ submitHandler: function(form) { // $.operate.save(prefix + "/edit", $('#form-locationType-edit').serialize()); - var tableValue = $.common.getTableValue("#form-locationType-edit"); + var tableValue = $.common.getTableValue("#form-locationHigh-edit"); $.operate.save(prefix + "/edit", tableValue); } }); diff --git a/src/main/resources/templates/config/locationHigh/locationHigh.html b/src/main/resources/templates/config/locationHigh/locationHigh.html index fe13266..f5d4713 100644 --- a/src/main/resources/templates/config/locationHigh/locationHigh.html +++ b/src/main/resources/templates/config/locationHigh/locationHigh.html @@ -41,6 +41,8 @@ var removeFlag = [[${@permission.hasPermi('config:locationType:remove')}]]; var prefix = ctx + "config/locationHigh" var datas = [[${@dict.getType('sys_normal_disable')}]]; + var rowFlags = [[${@dict.getType('rowFlag')}]]; + var high = [[${@dict.getType('high')}]]; $(function() { var options = { url: prefix + "/list", @@ -66,10 +68,17 @@ title : '库位类型编码' }, { - field : 'high', + field : 'highLevel', title : '高度值' }, { + field : 'high', + title : '高低位', + formatter: function(value, row, index) { + return $.table.selectDictLabel(high, value); + } + }, + { field : 'sequence', title : '顺序' }, diff --git a/src/main/resources/templates/config/material/edit.html b/src/main/resources/templates/config/material/edit.html index 92fd634..965f5e2 100644 --- a/src/main/resources/templates/config/material/edit.html +++ b/src/main/resources/templates/config/material/edit.html @@ -26,10 +26,7 @@ <div class="form-group"> <label class="col-sm-3 control-label">单位:</label> <div class="col-sm-8"> - <select id="unit" name="unit" class="form-control" th:with="materialType=${@dict.getType('materialType')}"> - <option th:each="item : ${materialType}" th:text="${item['dictLabel']}" th:value="${item['dictValue']}" - th:field="*{unit}" ></option> - </select> + <input id="unit" name="unit" class="form-control" type="text" th:field="*{unit}"> </div> </div> <div class="form-group"> diff --git a/src/main/resources/templates/config/material/editBatch.html b/src/main/resources/templates/config/material/editBatch.html index f3c7f82..9b8c70b 100644 --- a/src/main/resources/templates/config/material/editBatch.html +++ b/src/main/resources/templates/config/material/editBatch.html @@ -4,231 +4,28 @@ <head th:include="include :: header"></head> <body class="white-bg"> <div class="wrapper wrapper-content animated fadeInRight ibox-content"> - <form class="form-horizontal m" id="form-material-add"> - <input name="ids" hidden="hidden" th:value="${ids}"> + <form class="form-horizontal m" id="form-material-add" > + <input name="ids" hidden="hidden" th:value="${ids}" > <div class="form-group"> - <label class="col-sm-3 control-label">物料分区</label> + <label class="col-sm-3 control-label">物料分区编码</label> <div class="col-sm-8"> - <select id="area" name="area" class="form-control" th:with="areas=${@dict.getType('material_areas')}"> - <option th:each="item : ${areas}" th:text="${item['dictLabel']}" th:value="${item['dictValue']}"></option> - </select> + <input id="materialAreaCode" name="materialAreaCode" class="form-control" type="text"> </div> </div> - <!-- <div class="form-group">--> - <!-- <label class="col-sm-3 control-label">物料类别:</label>--> - <!-- <div class="col-sm-8">--> - <!-- <select id="type" name="type" class="form-control" th:with="materialType=${@materialType.queryType()}" th:field="*{type}">--> - <!-- <option th:each="item : ${materialType}" th:text="${item['name']}" th:value="${item['code']}"></option>--> - <!-- </select>--> - <!-- </div>--> - <!-- </div>--> - <!-- <div class="form-group">--> - <!-- <label class="col-sm-3 control-label">ABC分类:</label>--> - <!-- <div class="col-sdm-8">--> - <!-- <input id="abcClass" name="abcClass" class="form-control" type="text" th:field="*{abcClass}"/>--> - <!-- </div>--> - <!-- </div>--> - <!-- <div class="form-group">--> - <!-- <label class="col-sm-3 control-label">保质期(天)</label>--> - <!-- <div class="col-sm-8">--> - <!-- <input id="daysToExpire" name="daysToExpire" class="form-control" type="text" th:field="*{daysToExpire}"/>--> - <!-- </div>--> - <!-- </div>--> - <!-- <div class="form-group">--> - <!-- <label class="col-sm-3 control-label">定位规则:</label>--> - <!-- <div class="col-sm-8">--> - <!-- <input id="locatingRule" name="locatingRule" class="form-control" type="text" th:field="*{locatingRule}">--> - <!-- </div>--> - <!-- </div>--> - <!-- <div class="form-group">--> - <!-- <label class="col-sm-3 control-label">分配规则:</label>--> - <!-- <div class="col-sm-8">--> - <!-- <input id="allocationRule" name="allocationRule" class="form-control" type="text" th:field="*{allocationRule}">--> - <!-- </div>--> - <!-- </div>--> - <!-- <div class="form-group">--> - <!-- <label class="col-sm-3 control-label">补货规则:</label>--> - <!-- <div class="col-sm-8">--> - <!-- <input id="replenishmentRule" name="replenishmentRule" class="form-control" type="text" th:field="*{replenishmentRule}">--> - <!-- </div>--> - <!-- </div>--> - <!-- <div class="form-group">--> - <!-- <label class="col-sm-3 control-label">空货位规则:</label>--> - <!-- <div class="col-sm-8">--> - <!-- <input id="emptyLocRule" name="emptyLocRule" class="form-control" type="text" th:field="*{emptyLocRule}">--> - <!-- </div>--> - <!-- </div>--> - <!-- <div class="form-group">--> - <!-- <label class="col-sm-3 control-label">入库规则</label>--> - <!-- <div class="col-sm-8">--> - <!-- <input id="receivingFlow" name="receivingFlow" class="form-control" type="text" th:field="*{receivingFlow}">--> - <!-- </div>--> - <!-- </div>--> - <!-- <div class="form-group">--> - <!-- <label class="col-sm-3 control-label">出库流程:</label>--> - <!-- <div class="col-sm-8">--> - <!-- <input id="shippingFlow" name="shippingFlow" class="form-control" type="text" th:field="*{shippingFlow}">--> - <!-- </div>--> - <!-- </div>--> - <!-- <div class="form-group">--> - <!-- <label class="col-sm-3 control-label">属性模板:</label>--> - <!-- <div class="col-sm-8">--> - <!-- <input id="attributeTemplateCode" name="attributeTemplateCode" class="form-control" type="text" th:field="*{attributeTemplateCode}">--> - <!-- </div>--> - <!-- </div>--> - <!-- <div class="form-group">--> - <!-- <label class="col-sm-3 control-label">记录序列号:</label>--> - <!-- <div class="col-sm-8">--> - <!-- <input id="trackSerialNum" name="trackSerialNum" class="form-control" type="text" th:field="*{trackSerialNum}">--> - <!-- </div>--> - <!-- </div>--> - <!-- <div class="form-group">--> - <!-- <label class="col-sm-3 control-label">自动生成序列号:</label>--> - <!-- <div class="col-sm-8">--> - <!-- <input id="autoGenSerialNum" name="autoGenSerialNum" class="form-control" type="text" th:field="*{autoGenSerialNum}">--> - <!-- </div>--> - <!-- </div>--> - <!-- <div class="form-group">--> - <!-- <label class="col-sm-3 control-label">自动生成序列号表达式:</label>--> - <!-- <div class="col-sm-8">--> - <!-- <input id="autoGenSerialNumFormat" name="autoGenSerialNumFormat" class="form-control" type="text" th:field="*{autoGenSerialNumFormat}">--> - <!-- </div>--> - <!-- </div>--> - <!-- <div class="form-group">--> - <!-- <label class="col-sm-3 control-label">序列号模板:</label>--> - <!-- <div class="col-sm-8">--> - <!-- <input id="snTemplateCode" name="snTemplateCode" class="form-control" type="text" th:field="*{snTemplateCode}">--> - <!-- </div>--> - <!-- </div>--> - <!-- <div class="form-group">--> - <!-- <label class="col-sm-3 control-label">临期预警天数:</label>--> - <!-- <div class="col-sm-8">--> - <!-- <input id="expiringDays" name="expiringDays" class="form-control" type="text" th:field="*{expiringDays}">--> - <!-- </div>--> - <!-- </div>--> - <!-- <div class="form-group">--> - <!-- <label class="col-sm-3 control-label">收货预警天数:</label>--> - <!-- <div class="col-sm-8">--> - <!-- <input id="minShelfLifeDays" name="minShelfLifeDays" class="form-control" type="text" th:field="*{minShelfLifeDays}">--> - <!-- </div>--> - <!-- </div>--> - <!--<div class="form-group"> - <label class="col-sm-3 control-label">数据版本:</label> - <div class="col-sm-8"> - <input id="version" name="version" class="form-control" type="text"> - </div> - </div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">创建时间:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="created" name="created" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">创建用户:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="createdBy" name="createdBy" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">最后修改间:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="lastUpdated" name="lastUpdated" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">更新用户:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="lastUpdatedBy" name="lastUpdatedBy" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!-- <div class="form-group">--> - <!-- <label class="col-sm-3 control-label">状态:</label>--> - <!-- <div class="col-sm-8">--> - <!-- <div class="onoffswitch">--> - <!-- <input type="checkbox" th:checked="true" class="onoffswitch-checkbox" id="enable" name="enable">--> - <!-- <label class="onoffswitch-label" for="enable">--> - <!-- <span class="onoffswitch-inner"></span>--> - <!-- <span class="onoffswitch-switch"></span>--> - <!-- </label>--> - <!-- </div>--> - <!-- </div>--> - <!-- </div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">是否删除:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="deleted" name="deleted" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段1:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef1" name="userDef1" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段2:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef2" name="userDef2" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段3:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef3" name="userDef3" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段4:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef4" name="userDef4" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段5:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef5" name="userDef5" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段6:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef6" name="userDef6" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段7:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef7" name="userDef7" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <!--<div class="form-group"> --> - <!--<label class="col-sm-3 control-label">自定义字段8:</label>--> - <!--<div class="col-sm-8">--> - <!--<input id="userDef8" name="userDef8" class="form-control" type="text">--> - <!--</div>--> - <!--</div>--> - <div class="form-group"> - <div class="form-control-static col-sm-offset-9"> - <button type="submit" class="btn btn-primary">提交</button> - <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button> - </div> + <div class="form-group"> + <div class="form-control-static col-sm-offset-9"> + <button type="submit" class="btn btn-primary">提交</button> + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button> </div> + </div> </form> </div> <div th:include="include::footer"></div> <script type="text/javascript"> var prefix = ctx + "config/material"; $("#form-material-add").validate({ - rules: { - code: { - required: true, - }, - name: { - required: true, - } - }, + submitHandler: function (form) { var tableValue = $("#form-material-add").serialize(); $.operate.save(prefix + "/editBatchSave", tableValue); diff --git a/src/main/resources/templates/config/material/material.html b/src/main/resources/templates/config/material/material.html index 0f001b5..4894efb 100644 --- a/src/main/resources/templates/config/material/material.html +++ b/src/main/resources/templates/config/material/material.html @@ -70,6 +70,8 @@ var prefix = ctx + "config/material"; var datas = [[${@dict.getType('sys_normal_disable')}]]; var mType = [[${@materialType.queryType()}]]; + var materialArea = [[${@materialArea.queryCode()}]]; + $(function() { var options = { url: prefix + "/list", @@ -91,7 +93,7 @@ align: 'center', formatter: function(value, row, index) { var actions = []; - // actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); + actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>'); return actions.join(''); } @@ -121,11 +123,6 @@ } }, { - field : 'abcClass', - title : 'ABC分类' , - align: 'center', - }, - { field : 'name', title : '名称' }, @@ -134,9 +131,29 @@ title : '规格' }, { + field: 'materialAreaCode', + title: '物料分区', + align: 'center', + formatter: function(value, row, index) { + var actions = []; + $.each(materialArea, function(index, dict) { + if (dict.code == value) { + actions.push("<span class='badge badge-" + dict.code + "'>" + dict.name + "</span>"); + return false; + } + }); + return actions.join(''); + } + }, + { field : 'unit', title : '单位' , - visible:false + visible:true + }, + { + field : 'abcClass', + title : 'ABC分类' , + align: 'center', }, { field : 'daysToExpire', @@ -170,14 +187,17 @@ { field : 'attributeTemplateCode', title : '属性模板' , + visible:false, }, { field : 'trackSerialNum', title : '记录序列号' , + visible:false, }, { field : 'autoGenSerialNum', title : '自动生成序列号', + visible:false, align: 'center', formatter: function(value, row, index) { var actions = []; @@ -192,10 +212,12 @@ { field : 'autoGenSerialNumFormat', title : '自动生成序列号表达式' , + visible:false, }, { field : 'snTemplateCode', title : '序列号模板' , + visible:false, }, { field : 'expiringDays', @@ -238,6 +260,7 @@ { field: 'isMix', title: '是否允许混放', + visible:false, align: 'center', formatter: function (value, row, index) { return $.table.selectLogicLabel(value); diff --git a/src/main/resources/templates/config/materialArea/add.html b/src/main/resources/templates/config/materialArea/add.html new file mode 100644 index 0000000..401582a --- /dev/null +++ b/src/main/resources/templates/config/materialArea/add.html @@ -0,0 +1,44 @@ +<!DOCTYPE HTML> +<html lang="zh" xmlns:th="http://www.thymeleaf.org"> +<meta charset="utf-8"> +<head th:include="include :: header"></head> +<body class="white-bg"> + <div class="wrapper wrapper-content animated fadeInRight ibox-content"> + <form class="form-horizontal m" id="form-material-area"> + + <div class="form-group"> + <label class="col-sm-3 control-label">编码:</label> + <div class="col-sm-8"> + <input id="code" name="code" class="form-control" type="text"> + </div> + </div> + + <div class="form-group"> + <label class="col-sm-3 control-label">名字:</label> + <div class="col-sm-8"> + <input id="name" name="name" class="form-control" type="text"> + </div> + </div> + + <div class="form-group"> + <div class="form-control-static col-sm-offset-9"> + <button type="submit" class="btn btn-primary">提交</button> + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button> + </div> + </div> + + </form> + </div> + <div th:include="include::footer"></div> + <script type="text/javascript"> + var prefix = ctx + "config/materialArea"; + $("#form-material-area").validate({ + submitHandler: function(form) { + // $.operate.save(prefix + "/add", $('#form-locationType-add').serialize()); + var tableValue = $.common.getTableValue("#form-material-area"); + $.operate.save(prefix + "/add", tableValue); + } + }); + </script> +</body> +</html> diff --git a/src/main/resources/templates/config/materialArea/edit.html b/src/main/resources/templates/config/materialArea/edit.html new file mode 100644 index 0000000..94efd39 --- /dev/null +++ b/src/main/resources/templates/config/materialArea/edit.html @@ -0,0 +1,45 @@ +<!DOCTYPE HTML> +<html lang="zh" xmlns:th="http://www.thymeleaf.org"> +<meta charset="utf-8"> +<head th:include="include :: header"></head> +<body class="white-bg"> + <div class="wrapper wrapper-content animated fadeInRight ibox-content"> + <form class="form-horizontal m" id="form-materialArea-edit" th:object="${materialArea}"> + <input id="id" name="id" th:field="*{id}" type="hidden"> + + <div class="form-group"> + <label class="col-sm-3 control-label">编码:</label> + <div class="col-sm-8"> + <input id="code" name="code" th:field="*{code}" class="form-control" type="text"> + </div> + </div> + + <div class="form-group"> + <label class="col-sm-3 control-label">名字:</label> + <div class="col-sm-8"> + <input id="name" name="name" th:field="*{name}" class="form-control" type="text"> + </div> + </div> + + <div class="form-group"> + <div class="form-control-static col-sm-offset-9"> + <button type="submit" class="btn btn-primary">提交</button> + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button> + </div> + </div> + + </form> + </div> + <div th:include="include::footer"></div> + <script type="text/javascript"> + var prefix = ctx + "config/locationHigh"; + $("#form-materialArea-edit").validate({ + submitHandler: function(form) { + // $.operate.save(prefix + "/edit", $('#form-locationType-edit').serialize()); + var tableValue = $.common.getTableValue("#form-materialArea-edit"); + $.operate.save(prefix + "/edit", tableValue); + } + }); + </script> +</body> +</html> diff --git a/src/main/resources/templates/config/materialArea/materialArea.html b/src/main/resources/templates/config/materialArea/materialArea.html new file mode 100644 index 0000000..6950842 --- /dev/null +++ b/src/main/resources/templates/config/materialArea/materialArea.html @@ -0,0 +1,89 @@ +<!DOCTYPE HTML> +<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro"> +<meta charset="utf-8"> +<head th:include="include :: header"></head> +<body class="gray-bg"> + <div class="container-div"> + <div class="row"> + <div class="col-sm-12 select-info"> + <form id="materialArea-form"> + <div class="select-list"> + <li> + + <li> + <a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i> 搜索</a> + <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset('alarmLevel-form')"><i class="fa fa-refresh"></i> 重置</a> + <!--<a class="btn btn-success btn-rounded btn-sm" onclick="$.table.exportExcel()" shiro:hasPermission="system:role:export"><i class="fa fa-download"></i> 导出</a>--> + </li> + </ul> + </div> + </form> + </div> + <div class="btn-group hidden-xs" id="toolbar" role="group"> + <a class="btn btn-outline btn-success btn-rounded" onclick="$.operate.add()"> + <i class="fa fa-plus"></i> 新增 + </a> + <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()"> + <i class="fa fa-trash-o"></i> 删除 + </a> + </div> + + <div class="col-sm-12 select-info"> + <table id="bootstrap-table" data-mobile-responsive="true" class="table table-bordered table-hover"></table> + </div> + <div> + </div> + <div th:include="include :: footer"></div> + <script th:inline="javascript"> + var editFlag = [[${@permission.hasPermi('config:locationType:edit')}]]; + var removeFlag = [[${@permission.hasPermi('config:locationType:remove')}]]; + var prefix = ctx + "config/materialArea" + var datas = [[${@dict.getType('sys_normal_disable')}]]; + var rowFlags = [[${@dict.getType('rowFlag')}]]; + $(function() { + var options = { + url: prefix + "/list", + createUrl: prefix + "/add", + updateUrl: prefix + "/edit/{id}", + removeUrl: prefix + "/remove", + modalName: "物料分区", + search: false, + columns: [{ + checkbox: true + }, + { + field : 'warehouseCode', + title : '仓库编码' + }, + { + field : 'code', + title : '编码' + }, + { + field : 'name', + title : '名称' + }, + { + field : 'created', + title : '创建时间' + }, + { + field : 'createdBy', + title : '创建用户' + }, + { + title: '操作', + align: 'center', + formatter: function(value, row, index) { + var actions = []; + actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')" ><i class="fa fa-edit"></i>编辑</a> '); + actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')" ><i class="fa fa-trash-o"></i>删除</a>'); + return actions.join(''); + } + }] + }; + $.table.init(options); + }); + </script> +</body> +</html> \ No newline at end of file diff --git a/src/main/resources/templates/config/materialType/editBatch.html b/src/main/resources/templates/config/materialType/editBatch.html new file mode 100644 index 0000000..8f719e0 --- /dev/null +++ b/src/main/resources/templates/config/materialType/editBatch.html @@ -0,0 +1,36 @@ +<!DOCTYPE HTML> +<html lang="zh" xmlns:th="http://www.thymeleaf.org"> +<meta charset="utf-8"> +<head th:include="include :: header"></head> +<body class="white-bg"> +<div class="wrapper wrapper-content animated fadeInRight ibox-content"> + <form class="form-horizontal m" id="form-material-add" > + <input name="ids" hidden="hidden" th:value="${ids}" > + <div class="form-group"> + <label class="col-sm-3 control-label">物料分区编码</label> + <div class="col-sm-8"> + <input id="materialAreaCode" name="materialAreaCode" class="form-control" type="text"> + </div> + </div> + + <div class="form-group"> + <div class="form-control-static col-sm-offset-9"> + <button type="submit" class="btn btn-primary">提交</button> + <button onclick="$.modal.close()" class="btn btn-danger" type="button">关闭</button> + </div> + </div> + </form> +</div> +<div th:include="include::footer"></div> +<script type="text/javascript"> + var prefix = ctx + "config/materialType"; + $("#form-material-add").validate({ + + submitHandler: function (form) { + var tableValue = $("#form-material-add").serialize(); + $.operate.save(prefix + "/editBatchSave", tableValue); + } + }); +</script> +</body> +</html> diff --git a/src/main/resources/templates/config/materialType/materialType.html b/src/main/resources/templates/config/materialType/materialType.html index 7f142a7..b9c78f3 100644 --- a/src/main/resources/templates/config/materialType/materialType.html +++ b/src/main/resources/templates/config/materialType/materialType.html @@ -38,6 +38,9 @@ <a class="btn btn-outline btn-danger btn-rounded" onclick="$.operate.batRemove()" shiro:hasPermission="config:materialType:remove"> <i class="fa fa-trash-o"></i> 删除 </a> + <a class="btn btn-outline btn-success btn-rounded" onclick="batEdit()" shiro:hasPermission="config:materialType:add"> + <i class="fa fa-edit"></i> 批量编辑 + </a> </div> <div class="col-sm-12 select-info"> @@ -51,6 +54,7 @@ var removeFlag = [[${@permission.hasPermi('config:materialType:remove')}]]; var prefix = ctx + "config/materialType"; var datas = [[${@dict.getType('sys_normal_disable')}]]; + var materialArea = [[${@materialArea.queryCode()}]]; $(function() { var options = { url: prefix + "/list", @@ -88,74 +92,89 @@ title : 'ABC分类' }, { - field : 'daysToExpire', - title : '保质期(天)' - }, - { - field : 'receivingFlow', - title : '入库流程' - }, - { - field : 'shippingFlow', - title : '出库流程' - }, - { - field : 'locatingRule', - title : '定位规则' - }, - { - field : 'allocationRule', - title : '分配规则' - }, - { - field : 'replenishmentRule', - title : '补货规则' - }, - { - field : 'emptyLocRule', - title : '空货位规则' - }, - { - field : 'pickingRule', - title : '拣货规则' - }, - { - field : 'attributeTemplateCode', - title : '属性模版' - }, - { - field : 'trackSerialNum', - title : '记录序列号' - }, - { - field : 'autoGenSerialNum', - title : '自动生成序列号' - }, - { - field : 'autoGenSerialNumFormat', - title : '自动生成序列号表达式', - visible : false - }, - { - field : 'snTemplateCode', - title : '序列号模版' - }, - { - field : 'expiringDays', - title : '临期预警天数' - }, - { - field : 'minShelfLifeDays', - title : '收货预警天数' - }, - { - field : 'enable', - title : '是否启用', - formatter: function(value, row, index) { - return $.table.selectDictLabel(datas, value); - }, + field: 'materialAreaCode', + title: '物料分区', align: 'center', + formatter: function(value, row, index) { + var actions = []; + $.each(materialArea, function(index, dict) { + if (dict.code == value) { + actions.push("<span class='badge badge-" + dict.code + "'>" + dict.name + "</span>"); + return false; + } + }); + return actions.join(''); + } }, + // { + // field : 'daysToExpire', + // title : '保质期(天)' + // }, + // { + // field : 'receivingFlow', + // title : '入库流程' + // }, + // { + // field : 'shippingFlow', + // title : '出库流程' + // }, + // { + // field : 'locatingRule', + // title : '定位规则' + // }, + // { + // field : 'allocationRule', + // title : '分配规则' + // }, + // { + // field : 'replenishmentRule', + // title : '补货规则' + // }, + // { + // field : 'emptyLocRule', + // title : '空货位规则' + // }, + // { + // field : 'pickingRule', + // title : '拣货规则' + // }, + // { + // field : 'attributeTemplateCode', + // title : '属性模版' + // }, + // { + // field : 'trackSerialNum', + // title : '记录序列号' + // }, + // { + // field : 'autoGenSerialNum', + // title : '自动生成序列号' + // }, + // { + // field : 'autoGenSerialNumFormat', + // title : '自动生成序列号表达式', + // visible : false + // }, + // { + // field : 'snTemplateCode', + // title : '序列号模版' + // }, + // { + // field : 'expiringDays', + // title : '临期预警天数' + // }, + // { + // field : 'minShelfLifeDays', + // title : '收货预警天数' + // }, + // { + // field : 'enable', + // title : '是否启用', + // formatter: function(value, row, index) { + // return $.table.selectDictLabel(datas, value); + // }, + // align: 'center', + // }, { field : 'created', title : '创建时间' @@ -180,10 +199,10 @@ }, align: 'center', }, - { - field : 'userDef1', - title : '是否AGV区域发货' - }, + // { + // field : 'userDef1', + // title : '是否AGV区域发货' + // }, { field : 'userDef2', title : '自定义字段2' , @@ -217,6 +236,16 @@ }; $.table.init(options); }); + + function batEdit() { + let rows = $.table.selectColumns("id"); + if (rows.length == 0) { + $.modal.alertWarning("请至少选择一条记录"); + return; + } else { + $.modal.open("修改物料", prefix+"/editBatch/"+rows.join(",")); + } + } </script> </body> diff --git a/src/main/resources/templates/inventory/inventoryHeader/inventoryHeader.html b/src/main/resources/templates/inventory/inventoryHeader/inventoryHeader.html index 07fc26a..5eb0de4 100644 --- a/src/main/resources/templates/inventory/inventoryHeader/inventoryHeader.html +++ b/src/main/resources/templates/inventory/inventoryHeader/inventoryHeader.html @@ -168,7 +168,7 @@ { field: 'totalWeight', title: ' 总重量', - visible: false + visible: true }, { field: 'materialSkuQty', diff --git a/src/main/resources/templates/monitor/SystemLog/logview.html b/src/main/resources/templates/monitor/SystemLog/logview.html new file mode 100644 index 0000000..49145ff --- /dev/null +++ b/src/main/resources/templates/monitor/SystemLog/logview.html @@ -0,0 +1,16 @@ +<!DOCTYPE html> +<html lang="zh" xmlns:th="http://www.thymeleaf.org"> +<meta charset="UTF-8"> +<head th:include="include :: header"> +</head> +<body> +<div id="log" style="margin: 20px 20px"></div> +</body> +<div th:include="include :: footer"></div> +<script th:inline="javascript"> + function init() { + $("#log").html([[${log}]]) + } + init(); +</script> +</html> diff --git a/src/main/resources/templates/monitor/SystemLog/systemLog.html b/src/main/resources/templates/monitor/SystemLog/systemLog.html new file mode 100644 index 0000000..3ed1f2a --- /dev/null +++ b/src/main/resources/templates/monitor/SystemLog/systemLog.html @@ -0,0 +1,65 @@ +<!DOCTYPE html> +<html lang="zh" xmlns:th="http://www.thymeleaf.org"> +<meta charset="UTF-8"> +<head th:include="include :: header"> +</head> +<body class="gray-bg"> +<div class="col-sm-12" style="height: auto;"> + <div class="select-info" style="height: 100%;"> + <h1 style="margin-bottom: 15px;font-weight: bold ">系统日志</h1> + <div class="panel panel-info"> + <div class="panel-heading">一般日志</div> + <div class="panel-body"> + <a data-toggle="collapse" data-target="#infoLogList">sys-info</a> + <div class="panel-collapse collapse" style="margin-top: 10px" id="infoLogList"> + <ul th:each="name:${infoNames}"> + <li> + <a th:text="${name}" th:onclick="getLog([[${name}]])"></a> + </li> + </ul> + </div> + </div> + </div> + <div class="panel panel-primary"> + <div class="panel-heading">调试日志</div> + <div class="panel-body"> + <a data-toggle="collapse" data-target="#debugLogList">sys-debug</a> + <div class="panel-collapse collapse" style="margin-top: 10px" id="debugLogList"> + <ul th:each="name:${debugNames}"> + <li><a th:text="${name}" th:onclick="getLog([[${name}]])"></a></li> + </ul> + </div> + </div> + </div> + <div class="panel panel-warning"> + <div class="panel-heading">警告日志</div> + <div class="panel-body"> + <a data-toggle="collapse" data-target="#warnLogList">sys-warn</a> + <div class="panel-collapse collapse" style="margin-top: 10px" id="warnLogList"> + <ul th:each="name:${warnNames}"> + <li><a th:text="${name}" th:onclick="getLog([[${name}]])"></a></li> + </ul> + </div> + </div> + </div> + <div class="panel panel-danger"> + <div class="panel-heading">错误日志</div> + <div class="panel-body"> + <a data-toggle="collapse" data-target="#errorLogList">sys-error</a> + <div class="panel-collapse collapse" style="margin-top: 10px" id="errorLogList"> + <ul th:each="name:${errorNames}"> + <li><a th:text="${name}" th:onclick="getLog([[${name}]])"></a></li> + </ul> + </div> + </div> + </div> + </div> +</div> +</body> +<div th:include="include :: footer"></div> +<script th:inline="javascript"> + function getLog(name) { + $.modal.openFull(name, ctx+"monitor/systemLog/logview?name="+name) + } +</script> +</html> diff --git a/src/main/resources/templates/monitor/locationstatus/locationstatus.html b/src/main/resources/templates/monitor/locationstatus/locationstatus.html index 794039f..8670ab7 100644 --- a/src/main/resources/templates/monitor/locationstatus/locationstatus.html +++ b/src/main/resources/templates/monitor/locationstatus/locationstatus.html @@ -67,9 +67,9 @@ <option value="layer">层</option> </select> </li> - <li>货主编码: - <input type="text" name="receiptCompanyCode" id="receiptCompanyCode"> - </li> +<!-- <li>货主编码:--> +<!-- <input type="text" name="receiptCompanyCode" id="receiptCompanyCode">--> +<!-- </li>--> <li> <a class="btn btn-primary btn-rounded btn-sm" onclick="Search()"><i class="fa fa-search"></i> 搜索</a> </li> @@ -117,21 +117,22 @@ <li> 整盘禁用:<img src="../img/icon/整盘禁用.png"> </li> + <li><span style="font-size: 12px">库位统计情况:</span> + <input style="width: 400px; font-size: 12px" type="text" id="zone" disabled/> + </li> </ul><br><br> <ul id="info_list"> - <li><span>库区:</span><input type="text" id="zone" style="width: 450px" disabled/></li> <li><span>库位:</span><input type="text" id="code" disabled/></li> <li><span>容器编码:</span><input type="text" id="containerCode" disabled/></li> <li><span>物料信息:<select id="material" style="width: auto"><option>无</option></select></span></li> - <li> </li> <li> <a class="btn btn-success btn-rounded btn-sm" onclick="checkLocationCode()" shiro:hasPermission="inventory:inventory:seeOut"><i class="fa fa-eye"></i> 出库查看</a> </li> </ul> - <ul> - <li style="float:left;margin-left: 40px"><button type="button" class="btn btn-sm btn-success" onclick="searchLocation()">查看库位</button></li> - <li style="float:left;margin-left: 20px"><button type="button" class="btn btn-sm btn-success" onclick="searchInventory()">查看库存</button></li> - </ul> +<!-- <ul>--> +<!-- <li style="float:left;margin-left: 40px"><button type="button" class="btn btn-sm btn-success" onclick="searchLocation()">查看库位</button></li>--> +<!-- <li style="float:left;margin-left: 20px"><button type="button" class="btn btn-sm btn-success" onclick="searchInventory()">查看库存</button></li>--> +<!-- </ul>--> </div> </form> </div> @@ -625,8 +626,8 @@ }, success:function (response) { if (response.code==200){ - $("#zone").val("库位数量:"+response.data.location+", 空柜数量:"+response.data.emptyLocation+ - ", 空盘数量:"+response.data.haveContainLocation+", 半整盘库位数量:"+response.data.haveInventoryLocation) + $("#zone").val("库位总数:"+response.data.location+", 空闲库位:"+response.data.emptyLocation+ + ", 空托盘库位:"+response.data.haveContainLocation+", 有货库位:"+response.data.haveInventoryLocation) }else { $.modal.alertError(response.msg) } diff --git a/src/main/resources/templates/receipt/receiptHeader/receiptHeader.html b/src/main/resources/templates/receipt/receiptHeader/receiptHeader.html index 16d20f6..83393ad 100644 --- a/src/main/resources/templates/receipt/receiptHeader/receiptHeader.html +++ b/src/main/resources/templates/receipt/receiptHeader/receiptHeader.html @@ -202,7 +202,7 @@ </div> <div th:include="include :: footer"></div> <script th:inline="javascript"> - var printFlag = [[${@permission.hasPermi('receipt:receiptHeader:report')}]]; + var printFlag = [[${@permission.hasPremi('receipt:receiptHeader:report')}]]; var editFlag = [[${@permission.hasPermi('receipt:receiptHeader:edit')}]]; var removeFlag = [[${@permission.hasPermi('receipt:receiptHeader:remove')}]]; let receiveFlag = [[${@permission.hasPermi('receipt:receiptHeader:receive')}]]; diff --git a/src/main/resources/templates/shipment/shipmentHeader/shipmentHeader.html b/src/main/resources/templates/shipment/shipmentHeader/shipmentHeader.html index fef7cf4..8bf19b9 100644 --- a/src/main/resources/templates/shipment/shipmentHeader/shipmentHeader.html +++ b/src/main/resources/templates/shipment/shipmentHeader/shipmentHeader.html @@ -333,7 +333,7 @@ { field: 'projectCode', title: '项目号', - sortable:true + visible: false }, { field: 'shipmentType', @@ -379,7 +379,8 @@ }, { field: 'waveId', - title: '波次号' + title: '波次号', + visible: false }, { field: 'totalQty',