| @@ -165,7 +165,15 @@ open class M18MasterDataService( | |||||
| maxQty = null, | maxQty = null, | ||||
| m18Id = id, | m18Id = id, | ||||
| m18LastModifyDate = commonUtils.timestampToLocalDateTime(pro.lastModifyDate), | m18LastModifyDate = commonUtils.timestampToLocalDateTime(pro.lastModifyDate), | ||||
| qcCategoryId = null | |||||
| qcCategoryId = null, | |||||
| store_id = null, | |||||
| warehouse = null, | |||||
| area = null, | |||||
| slot = null, | |||||
| LocationCode = null, | |||||
| isEgg = null, | |||||
| isFee = null, | |||||
| isBag = null | |||||
| ) | ) | ||||
| val savedItem = itemsService.saveItem(saveItemRequest) | val savedItem = itemsService.saveItem(saveItemRequest) | ||||
| @@ -260,7 +268,15 @@ open class M18MasterDataService( | |||||
| maxQty = null, | maxQty = null, | ||||
| m18Id = item.id, | m18Id = item.id, | ||||
| m18LastModifyDate = commonUtils.timestampToLocalDateTime(pro.lastModifyDate), | m18LastModifyDate = commonUtils.timestampToLocalDateTime(pro.lastModifyDate), | ||||
| qcCategoryId = null | |||||
| qcCategoryId = null, | |||||
| store_id = null, | |||||
| warehouse = null, | |||||
| area = null, | |||||
| slot = null, | |||||
| LocationCode = null, | |||||
| isEgg = null, | |||||
| isFee = null, | |||||
| isBag = null | |||||
| ) | ) | ||||
| val savedItem = itemsService.saveItem(saveItemRequest) | val savedItem = itemsService.saveItem(saveItemRequest) | ||||
| @@ -392,7 +392,10 @@ open class ItemsService( | |||||
| "i.id, " + | "i.id, " + | ||||
| "i.code, " + | "i.code, " + | ||||
| "i.name, " + | "i.name, " + | ||||
| "i.description " + | |||||
| "i.description, " + | |||||
| "i.type, " + | |||||
| "i.`LocationCode` as LocationCode, " + | |||||
| "i.`qcCategoryId` as qcCategoryId " + | |||||
| "FROM items i " + | "FROM items i " + | ||||
| "WHERE i.deleted = FALSE" | "WHERE i.deleted = FALSE" | ||||
| ); | ); | ||||
| @@ -512,6 +515,14 @@ open class ItemsService( | |||||
| this.qcCategory = qcCategory | this.qcCategory = qcCategory | ||||
| m18Id = request.m18Id ?: this.m18Id | m18Id = request.m18Id ?: this.m18Id | ||||
| m18LastModifyDate = request.m18LastModifyDate ?: this.m18LastModifyDate | m18LastModifyDate = request.m18LastModifyDate ?: this.m18LastModifyDate | ||||
| store_id = request.store_id | |||||
| warehouse = request.warehouse | |||||
| area = request.area | |||||
| slot = request.slot | |||||
| LocationCode = request.LocationCode | |||||
| isEgg = request.isEgg ?: false | |||||
| isFee = request.isFee ?: false | |||||
| isBag = request.isBag ?: false | |||||
| } | } | ||||
| logger.info("saving item: $item") | logger.info("saving item: $item") | ||||
| val savedItem = itemsRepository.saveAndFlush(item) | val savedItem = itemsRepository.saveAndFlush(item) | ||||
| @@ -45,6 +45,14 @@ data class NewItemRequest( | |||||
| val m18Id: Long?, | val m18Id: Long?, | ||||
| val m18LastModifyDate: LocalDateTime?, | val m18LastModifyDate: LocalDateTime?, | ||||
| val qcCategoryId: Long?, | val qcCategoryId: Long?, | ||||
| val store_id: String?, | |||||
| val warehouse: String?, | |||||
| val area: String?, | |||||
| val slot: String?, | |||||
| val LocationCode: String?, | |||||
| val isEgg: Boolean?, | |||||
| val isFee: Boolean?, | |||||
| val isBag: Boolean?, | |||||
| // val type: List<NewTypeRequest>?, | // val type: List<NewTypeRequest>?, | ||||
| // val uom: List<NewUomRequest>?, | // val uom: List<NewUomRequest>?, | ||||
| // val weightUnit: List<NewWeightUnitRequest>?, | // val weightUnit: List<NewWeightUnitRequest>?, | ||||
| @@ -61,7 +61,7 @@ interface TruckRepository : AbstractRepository<Truck, Long> { | |||||
| @Query( | @Query( | ||||
| nativeQuery = true, | nativeQuery = true, | ||||
| value = """ | value = """ | ||||
| SELECT s.id as id, s.code as code, s.name as name, s.contactNo as contactNo, | |||||
| SELECT s.id as id, t.ShopCode as code, s.name as name, s.contactNo as contactNo, | |||||
| s.contactEmail as contactEmail, s.contactName as contactName, | s.contactEmail as contactEmail, s.contactName as contactName, | ||||
| s.addr1 as addr1, s.addr2 as addr2, s.addr3 as addr3, s.type as type, | s.addr1 as addr1, s.addr2 as addr2, s.addr3 as addr3, s.type as type, | ||||
| t.TruckLanceCode as truckLanceCode, t.DepartureTime as departureTime, | t.TruckLanceCode as truckLanceCode, t.DepartureTime as departureTime, | ||||
| @@ -69,11 +69,9 @@ interface TruckRepository : AbstractRepository<Truck, Long> { | |||||
| t.Store_id as Store_id, t.remark as remark, t.id as truckId | t.Store_id as Store_id, t.remark as remark, t.id as truckId | ||||
| FROM shop s INNER JOIN truck t ON s.id = t.shopId | FROM shop s INNER JOIN truck t ON s.id = t.shopId | ||||
| WHERE t.TruckLanceCode = :truckLanceCode | WHERE t.TruckLanceCode = :truckLanceCode | ||||
| AND ((:remark = '' AND (t.remark IS NULL OR t.remark = '')) | |||||
| OR (:remark != '' AND t.remark = :remark)) | |||||
| AND t.deleted = false | AND t.deleted = false | ||||
| AND s.deleted = false; | AND s.deleted = false; | ||||
| """ | """ | ||||
| ) | ) | ||||
| fun findAllFromShopAndTruckByTruckLanceCodeAndRemarkAndDeletedFalse(@Param("truckLanceCode") truckLanceCode: String, @Param("remark") remark: String): List<ShopAndTruck> | |||||
| fun findAllFromShopAndTruckByTruckLanceCodeAndDeletedFalse(@Param("truckLanceCode") truckLanceCode: String): List<ShopAndTruck> | |||||
| } | } | ||||
| @@ -250,8 +250,8 @@ open class TruckService( | |||||
| return truckRepository.findAllUniqueTruckLanceCodeAndRemarkCombinations() | return truckRepository.findAllUniqueTruckLanceCodeAndRemarkCombinations() | ||||
| } | } | ||||
| open fun findAllFromShopAndTruckByTruckLanceCodeAndRemarkAndDeletedFalse(truckLanceCode: String, remark: String): List<ShopAndTruck> { | |||||
| return truckRepository.findAllFromShopAndTruckByTruckLanceCodeAndRemarkAndDeletedFalse(truckLanceCode, remark) | |||||
| open fun findAllFromShopAndTruckByTruckLanceCodeAndDeletedFalse(truckLanceCode: String): List<ShopAndTruck> { | |||||
| return truckRepository.findAllFromShopAndTruckByTruckLanceCodeAndDeletedFalse(truckLanceCode) | |||||
| } | } | ||||
| @Transactional | @Transactional | ||||
| @@ -182,9 +182,9 @@ class TruckController( | |||||
| } | } | ||||
| @GetMapping("/findAllFromShopAndTruckByTruckLanceCodeAndRemarkAndDeletedFalse") | |||||
| fun findAllFromShopAndTruckByTruckLanceCodeAndRemarkAndDeletedFalse(@RequestParam truckLanceCode: String, @RequestParam remark: String): List<ShopAndTruck> { | |||||
| return truckService.findAllFromShopAndTruckByTruckLanceCodeAndRemarkAndDeletedFalse(truckLanceCode, remark) | |||||
| @GetMapping("/findAllFromShopAndTruckByTruckLanceCodeAndDeletedFalse") | |||||
| fun findAllFromShopAndTruckByTruckLanceCodeAndDeletedFalse(@RequestParam truckLanceCode: String): List<ShopAndTruck> { | |||||
| return truckService.findAllFromShopAndTruckByTruckLanceCodeAndDeletedFalse(truckLanceCode) | |||||
| } | } | ||||
| @PostMapping("/updateLoadingSequence") | @PostMapping("/updateLoadingSequence") | ||||