diff --git a/youchain-system/src/main/java/com/youchain/basicdata/domain/BigItem.java b/youchain-system/src/main/java/com/youchain/basicdata/domain/BigItem.java index b17741c..4b518d9 100644 --- a/youchain-system/src/main/java/com/youchain/basicdata/domain/BigItem.java +++ b/youchain-system/src/main/java/com/youchain/basicdata/domain/BigItem.java @@ -1,40 +1,42 @@ /* -* Copyright 2019-2020 Zheng Jie -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright 2019-2020 Zheng Jie + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.youchain.basicdata.domain; import com.youchain.base.BaseEntity; +import com.youchain.modules.system.domain.Dept; import lombok.Data; import cn.hutool.core.bean.BeanUtil; import io.swagger.annotations.ApiModelProperty; import cn.hutool.core.bean.copier.CopyOptions; + import javax.persistence.*; import javax.validation.constraints.*; import java.sql.Timestamp; import java.io.Serializable; /** -* @website https://eladmin.vip -* @description / -* @author shenyinan -* @date 2024-02-21 -**/ + * @author shenyinan + * @website https://eladmin.vip + * @description / + * @date 2024-02-21 + **/ @Entity @Data -@Table(name="base_big_item") -public class BigItem extends BaseEntity implements Serializable { +@Table(name = "base_big_item") +public class BigItem extends BaseEntity implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -58,12 +60,13 @@ public class BigItem extends BaseEntity implements Serializable { @ApiModelProperty(value = "备注") private String remark; - @Column(name = "`dept_id`") - @ApiModelProperty(value = "仓库ID") - private Long deptId; + @OneToOne + @JoinColumn(name = "dept_id") + @ApiModelProperty(value = "仓库") + private Dept dept; - public void copy(BigItem source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); + public void copy(BigItem source) { + BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true)); } } diff --git a/youchain-system/src/main/java/com/youchain/basicdata/domain/PackageCheck.java b/youchain-system/src/main/java/com/youchain/basicdata/domain/PackageCheck.java new file mode 100644 index 0000000..5b3fc74 --- /dev/null +++ b/youchain-system/src/main/java/com/youchain/basicdata/domain/PackageCheck.java @@ -0,0 +1,86 @@ +/* + * Copyright 2019-2020 Zheng Jie + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.youchain.basicdata.domain; + +import com.youchain.base.BaseEntity; +import com.youchain.modules.system.domain.Dept; +import lombok.Data; +import cn.hutool.core.bean.BeanUtil; +import io.swagger.annotations.ApiModelProperty; +import cn.hutool.core.bean.copier.CopyOptions; + +import javax.persistence.*; +import javax.validation.constraints.*; +import java.sql.Timestamp; +import java.io.Serializable; + +/** + * @author huojin + * @website https://eladmin.vip + * @description / + * @date 2024-06-13 + **/ +@Entity +@Data +@Table(name = "base_package_check") +public class PackageCheck extends BaseEntity implements Serializable { + + @Id + @GeneratedValue(strategy = GenerationType.IDENTITY) + @Column(name = "`id`") + @ApiModelProperty(value = "ID") + private Long id; + + @Column(name = "`code`", unique = true, nullable = false) + @NotBlank + @ApiModelProperty(value = "成套代码") + private String code; + + @OneToOne + @JoinColumn(name = "`item_id`", nullable = false) + @NotNull + @ApiModelProperty(value = "物料") + private Item item; + + @OneToOne + @JoinColumn(name = "dept_id") + @ApiModelProperty(value = "仓库") + private Dept dept; + + @Column(name = "`quantity`") + @ApiModelProperty(value = "套数") + private Double quantity; + + @Column(name = "`create_by`") + @ApiModelProperty(value = "创建人") + private String createBy; + + @Column(name = "`update_by`") + @ApiModelProperty(value = "修改人") + private String updateBy; + + @Column(name = "`create_time`") + @ApiModelProperty(value = "创建时间") + private Timestamp createTime; + + @Column(name = "`update_time`") + @ApiModelProperty(value = "修改时间") + private Timestamp updateTime; + + public void copy(PackageCheck source) { + BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true)); + } +} diff --git a/youchain-system/src/main/java/com/youchain/basicdata/domain/Zcjxb.java b/youchain-system/src/main/java/com/youchain/basicdata/domain/Zcjxb.java index f29dce0..263802e 100644 --- a/youchain-system/src/main/java/com/youchain/basicdata/domain/Zcjxb.java +++ b/youchain-system/src/main/java/com/youchain/basicdata/domain/Zcjxb.java @@ -1,18 +1,18 @@ /* -* Copyright 2019-2020 Zheng Jie -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright 2019-2020 Zheng Jie + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.youchain.basicdata.domain; import com.youchain.base.BaseEntity; @@ -20,21 +20,22 @@ import lombok.Data; import cn.hutool.core.bean.BeanUtil; import io.swagger.annotations.ApiModelProperty; import cn.hutool.core.bean.copier.CopyOptions; + import javax.persistence.*; import javax.validation.constraints.*; import java.sql.Timestamp; import java.io.Serializable; /** -* @website https://eladmin.vip -* @description / -* @author dengjiangkun -* @date 2023-12-15 -**/ + * @author dengjiangkun + * @website https://eladmin.vip + * @description / + * @date 2023-12-15 + **/ @Entity @Data -@Table(name="base_zcjxb") -public class Zcjxb extends BaseEntity implements Serializable { +@Table(name = "base_zcjxb") +public class Zcjxb extends BaseEntity implements Serializable { @Id @GeneratedValue(strategy = GenerationType.IDENTITY) @@ -42,27 +43,27 @@ public class Zcjxb extends BaseEntity implements Serializable { @ApiModelProperty(value = "id") private Long id; - @Column(name = "`code`",nullable = false) + @Column(name = "`code`", nullable = false) @NotNull @ApiModelProperty(value = "机械臂机台号") private Integer code; - @Column(name = "`ip`",nullable = false) + @Column(name = "`ip`", nullable = false) @NotBlank @ApiModelProperty(value = "ip地址") private String ip; - @Column(name = "`port`",nullable = false) + @Column(name = "`port`", nullable = false) @NotNull @ApiModelProperty(value = "端口号") private Integer port; - @Column(name = "`communication_type`",nullable = false) + @Column(name = "`communication_type`", nullable = false) @NotBlank @ApiModelProperty(value = "通信类型") private String communicationType; - @Column(name = "`address`",nullable = false) + @Column(name = "`address`", nullable = false) @NotNull @ApiModelProperty(value = "DB地址") private Integer address; @@ -150,7 +151,7 @@ public class Zcjxb extends BaseEntity implements Serializable { @ApiModelProperty(value = "异常日志") private String errorTxt; - public void copy(Zcjxb source){ - BeanUtil.copyProperties(source,this, CopyOptions.create().setIgnoreNullValue(true)); + public void copy(Zcjxb source) { + BeanUtil.copyProperties(source, this, CopyOptions.create().setIgnoreNullValue(true)); } } diff --git a/youchain-system/src/main/java/com/youchain/basicdata/repository/PackageCheckRepository.java b/youchain-system/src/main/java/com/youchain/basicdata/repository/PackageCheckRepository.java new file mode 100644 index 0000000..75a2e59 --- /dev/null +++ b/youchain-system/src/main/java/com/youchain/basicdata/repository/PackageCheckRepository.java @@ -0,0 +1,34 @@ +/* +* Copyright 2019-2020 Zheng Jie +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +package com.youchain.basicdata.repository; + +import com.youchain.basicdata.domain.PackageCheck; +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; + +/** +* @website https://eladmin.vip +* @author huojin +* @date 2024-06-13 +**/ +public interface PackageCheckRepository extends JpaRepository, JpaSpecificationExecutor { + /** + * 根据 Code 查询 + * @param code / + * @return / + */ + PackageCheck findByCode(String code); +} \ No newline at end of file diff --git a/youchain-system/src/main/java/com/youchain/basicdata/rest/AgvSceneController.java b/youchain-system/src/main/java/com/youchain/basicdata/rest/AgvSceneController.java index 513a6fb..c96696f 100644 --- a/youchain-system/src/main/java/com/youchain/basicdata/rest/AgvSceneController.java +++ b/youchain-system/src/main/java/com/youchain/basicdata/rest/AgvSceneController.java @@ -19,6 +19,7 @@ import com.youchain.annotation.Log; import com.youchain.basicdata.domain.AgvScene; import com.youchain.basicdata.service.AgvSceneService; import com.youchain.basicdata.service.dto.AgvSceneQueryCriteria; +import com.youchain.utils.UserUtils; import org.springframework.data.domain.Pageable; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; @@ -69,6 +70,7 @@ public class AgvSceneController { @ApiOperation("新增agv_scene") @PreAuthorize("@el.check('agvScene:add')") public ResponseEntity createAgvScene(@Validated @RequestBody AgvScene resources){ + resources.setDept(UserUtils.getDept()); return new ResponseEntity<>(agvSceneService.create(resources),HttpStatus.CREATED); } diff --git a/youchain-system/src/main/java/com/youchain/basicdata/rest/BigBomController.java b/youchain-system/src/main/java/com/youchain/basicdata/rest/BigBomController.java index ef440a6..79397af 100644 --- a/youchain-system/src/main/java/com/youchain/basicdata/rest/BigBomController.java +++ b/youchain-system/src/main/java/com/youchain/basicdata/rest/BigBomController.java @@ -19,6 +19,7 @@ import com.youchain.annotation.Log; import com.youchain.basicdata.domain.BigBom; import com.youchain.basicdata.service.BigBomService; import com.youchain.basicdata.service.dto.BigBomQueryCriteria; +import com.youchain.utils.UserUtils; import org.springframework.data.domain.Pageable; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; @@ -62,6 +63,7 @@ public class BigBomController { @ApiOperation("新增bigBom") @PreAuthorize("@el.check('bigBom:add')") public ResponseEntity createBigBom(@Validated @RequestBody BigBom resources){ + resources.setDept(UserUtils.getDept()); return new ResponseEntity<>(bigBomService.create(resources),HttpStatus.CREATED); } diff --git a/youchain-system/src/main/java/com/youchain/basicdata/rest/BigItemController.java b/youchain-system/src/main/java/com/youchain/basicdata/rest/BigItemController.java index 3771379..489b209 100644 --- a/youchain-system/src/main/java/com/youchain/basicdata/rest/BigItemController.java +++ b/youchain-system/src/main/java/com/youchain/basicdata/rest/BigItemController.java @@ -1,24 +1,25 @@ /* -* Copyright 2019-2020 Zheng Jie -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright 2019-2020 Zheng Jie + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.youchain.basicdata.rest; import com.youchain.annotation.Log; import com.youchain.basicdata.domain.BigItem; import com.youchain.basicdata.service.BigItemService; import com.youchain.basicdata.service.dto.BigItemQueryCriteria; +import com.youchain.utils.UserUtils; import org.springframework.data.domain.Pageable; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; @@ -27,14 +28,15 @@ import org.springframework.security.access.prepost.PreAuthorize; import org.springframework.validation.annotation.Validated; import org.springframework.web.bind.annotation.*; import io.swagger.annotations.*; + import java.io.IOException; import javax.servlet.http.HttpServletResponse; /** -* @website https://eladmin.vip -* @author shenyinan -* @date 2024-02-21 -**/ + * @author shenyinan + * @website https://eladmin.vip + * @date 2024-02-21 + **/ @RestController @RequiredArgsConstructor @Api(tags = "bigitem管理") @@ -53,29 +55,30 @@ public class BigItemController { @GetMapping @ApiOperation("查询bigitem") - public ResponseEntity queryBigItem(BigItemQueryCriteria criteria, Pageable pageable){ - return new ResponseEntity<>(bigItemService.queryAll(criteria,pageable),HttpStatus.OK); + public ResponseEntity queryBigItem(BigItemQueryCriteria criteria, Pageable pageable) { + return new ResponseEntity<>(bigItemService.queryAll(criteria, pageable), HttpStatus.OK); } @GetMapping("/All") @ApiOperation("查询所有bigitem") - public ResponseEntity queryAllBigItem(BigItemQueryCriteria criteria){ - return new ResponseEntity<>(bigItemService.queryAll(criteria),HttpStatus.OK); + public ResponseEntity queryAllBigItem(BigItemQueryCriteria criteria) { + return new ResponseEntity<>(bigItemService.queryAll(criteria), HttpStatus.OK); } @PostMapping @Log("新增bigitem") @ApiOperation("新增bigitem") @PreAuthorize("@el.check('bigItem:add')") - public ResponseEntity createBigItem(@Validated @RequestBody BigItem resources){ - return new ResponseEntity<>(bigItemService.create(resources),HttpStatus.CREATED); + public ResponseEntity createBigItem(@Validated @RequestBody BigItem resources) { + resources.setDept(UserUtils.getDept()); + return new ResponseEntity<>(bigItemService.create(resources), HttpStatus.CREATED); } @PutMapping @Log("修改bigitem") @ApiOperation("修改bigitem") @PreAuthorize("@el.check('bigItem:edit')") - public ResponseEntity updateBigItem(@Validated @RequestBody BigItem resources){ + public ResponseEntity updateBigItem(@Validated @RequestBody BigItem resources) { bigItemService.update(resources); return new ResponseEntity<>(HttpStatus.NO_CONTENT); } diff --git a/youchain-system/src/main/java/com/youchain/basicdata/rest/BillTypeController.java b/youchain-system/src/main/java/com/youchain/basicdata/rest/BillTypeController.java index 09718f3..f456b17 100644 --- a/youchain-system/src/main/java/com/youchain/basicdata/rest/BillTypeController.java +++ b/youchain-system/src/main/java/com/youchain/basicdata/rest/BillTypeController.java @@ -19,6 +19,7 @@ import com.youchain.annotation.Log; import com.youchain.basicdata.domain.BillType; import com.youchain.basicdata.service.BillTypeService; import com.youchain.basicdata.service.dto.BillTypeQueryCriteria; +import com.youchain.utils.UserUtils; import org.springframework.data.domain.Pageable; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; @@ -62,6 +63,7 @@ public class BillTypeController { @ApiOperation("新增bill_type") @PreAuthorize("@el.check('billType:add')") public ResponseEntity createBillType(@Validated @RequestBody BillType resources){ + resources.setDept(UserUtils.getDept()); return new ResponseEntity<>(billTypeService.create(resources),HttpStatus.CREATED); } diff --git a/youchain-system/src/main/java/com/youchain/basicdata/rest/BoxController.java b/youchain-system/src/main/java/com/youchain/basicdata/rest/BoxController.java index e4aca28..5e36df1 100644 --- a/youchain-system/src/main/java/com/youchain/basicdata/rest/BoxController.java +++ b/youchain-system/src/main/java/com/youchain/basicdata/rest/BoxController.java @@ -50,10 +50,6 @@ public class BoxController { private final BoxService boxService; - private final CodeUtils codeUtils; - - - @Log("导出数据") @ApiOperation("导出数据") @GetMapping(value = "/download") diff --git a/youchain-system/src/main/java/com/youchain/basicdata/rest/CarRegController.java b/youchain-system/src/main/java/com/youchain/basicdata/rest/CarRegController.java index c7b686f..f213c17 100644 --- a/youchain-system/src/main/java/com/youchain/basicdata/rest/CarRegController.java +++ b/youchain-system/src/main/java/com/youchain/basicdata/rest/CarRegController.java @@ -19,6 +19,7 @@ import com.youchain.annotation.Log; import com.youchain.basicdata.domain.CarReg; import com.youchain.basicdata.service.CarRegService; import com.youchain.basicdata.service.dto.CarRegQueryCriteria; +import com.youchain.utils.UserUtils; import org.springframework.data.domain.Pageable; import lombok.RequiredArgsConstructor; import org.springframework.http.HttpStatus; diff --git a/youchain-system/src/main/java/com/youchain/basicdata/rest/PackageCheckController.java b/youchain-system/src/main/java/com/youchain/basicdata/rest/PackageCheckController.java new file mode 100644 index 0000000..38e8ee9 --- /dev/null +++ b/youchain-system/src/main/java/com/youchain/basicdata/rest/PackageCheckController.java @@ -0,0 +1,89 @@ +/* + * Copyright 2019-2020 Zheng Jie + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.youchain.basicdata.rest; + +import com.youchain.annotation.Log; +import com.youchain.basicdata.domain.PackageCheck; +import com.youchain.basicdata.service.PackageCheckService; +import com.youchain.basicdata.service.dto.PackageCheckQueryCriteria; +import com.youchain.utils.UserUtils; +import org.springframework.data.domain.Pageable; +import lombok.RequiredArgsConstructor; +import org.springframework.http.HttpStatus; +import org.springframework.http.ResponseEntity; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.validation.annotation.Validated; +import org.springframework.web.bind.annotation.*; +import io.swagger.annotations.*; + +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; + +/** + * @author huojin + * @website https://eladmin.vip + * @date 2024-06-13 + **/ +@RestController +@RequiredArgsConstructor +@Api(tags = "package_check管理") +@RequestMapping("/api/packageCheck") +public class PackageCheckController { + + private final PackageCheckService packageCheckService; + + @Log("导出数据") + @ApiOperation("导出数据") + @GetMapping(value = "/download") + @PreAuthorize("@el.check('packageCheck:list')") + public void exportPackageCheck(HttpServletResponse response, PackageCheckQueryCriteria criteria) throws IOException { + packageCheckService.download(packageCheckService.queryAll(criteria), response); + } + + @GetMapping + @ApiOperation("查询package_check") + @PreAuthorize("@el.check('packageCheck:list')") + public ResponseEntity queryPackageCheck(PackageCheckQueryCriteria criteria, Pageable pageable) { + return new ResponseEntity<>(packageCheckService.queryAll(criteria, pageable), HttpStatus.OK); + } + + @PostMapping + @Log("新增package_check") + @ApiOperation("新增package_check") + @PreAuthorize("@el.check('packageCheck:add')") + public ResponseEntity createPackageCheck(@Validated @RequestBody PackageCheck resources) { + resources.setDept(UserUtils.getDept()); + return new ResponseEntity<>(packageCheckService.create(resources), HttpStatus.CREATED); + } + + @PutMapping + @Log("修改package_check") + @ApiOperation("修改package_check") + @PreAuthorize("@el.check('packageCheck:edit')") + public ResponseEntity updatePackageCheck(@Validated @RequestBody PackageCheck resources) { + packageCheckService.update(resources); + return new ResponseEntity<>(HttpStatus.NO_CONTENT); + } + + @DeleteMapping + @Log("删除package_check") + @ApiOperation("删除package_check") + @PreAuthorize("@el.check('packageCheck:del')") + public ResponseEntity deletePackageCheck(@RequestBody Long[] ids) { + packageCheckService.deleteAll(ids); + return new ResponseEntity<>(HttpStatus.OK); + } +} diff --git a/youchain-system/src/main/java/com/youchain/basicdata/service/PackageCheckService.java b/youchain-system/src/main/java/com/youchain/basicdata/service/PackageCheckService.java new file mode 100644 index 0000000..62505da --- /dev/null +++ b/youchain-system/src/main/java/com/youchain/basicdata/service/PackageCheckService.java @@ -0,0 +1,83 @@ +/* +* Copyright 2019-2020 Zheng Jie +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +package com.youchain.basicdata.service; + +import com.youchain.basicdata.domain.PackageCheck; +import com.youchain.basicdata.service.dto.PackageCheckDto; +import com.youchain.basicdata.service.dto.PackageCheckQueryCriteria; +import org.springframework.data.domain.Pageable; +import java.util.Map; +import java.util.List; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; + +/** +* @website https://eladmin.vip +* @description 服务接口 +* @author huojin +* @date 2024-06-13 +**/ +public interface PackageCheckService { + + /** + * 查询数据分页 + * @param criteria 条件 + * @param pageable 分页参数 + * @return Map + */ + Map queryAll(PackageCheckQueryCriteria criteria, Pageable pageable); + + /** + * 查询所有数据不分页 + * @param criteria 条件参数 + * @return List + */ + List queryAll(PackageCheckQueryCriteria criteria); + + /** + * 根据ID查询 + * @param id ID + * @return PackageCheckDto + */ + PackageCheckDto findById(Long id); + + /** + * 创建 + * @param resources / + * @return PackageCheckDto + */ + PackageCheckDto create(PackageCheck resources); + + /** + * 编辑 + * @param resources / + */ + void update(PackageCheck resources); + + /** + * 多选删除 + * @param ids / + */ + void deleteAll(Long[] ids); + + /** + * 导出数据 + * @param all 待导出的数据 + * @param response / + * @throws IOException / + */ + void download(List all, HttpServletResponse response) throws IOException; +} \ No newline at end of file diff --git a/youchain-system/src/main/java/com/youchain/basicdata/service/dto/BigBomDto.java b/youchain-system/src/main/java/com/youchain/basicdata/service/dto/BigBomDto.java index 3c89cdc..32d695e 100644 --- a/youchain-system/src/main/java/com/youchain/basicdata/service/dto/BigBomDto.java +++ b/youchain-system/src/main/java/com/youchain/basicdata/service/dto/BigBomDto.java @@ -1,58 +1,75 @@ /* -* Copyright 2019-2020 Zheng Jie -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright 2019-2020 Zheng Jie + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.youchain.basicdata.service.dto; import com.youchain.basicdata.domain.BigItem; import com.youchain.basicdata.domain.Item; import lombok.Data; + import java.sql.Timestamp; import java.io.Serializable; /** -* @website https://eladmin.vip -* @description / -* @author shenyinan -* @date 2024-02-21 -**/ + * @author shenyinan + * @website https://eladmin.vip + * @description / + * @date 2024-02-21 + **/ @Data public class BigBomDto implements Serializable { private Long id; - /** bigitemID */ + /** + * bigitemID + */ private BigItem bigItem; - /** itemID */ + /** + * itemID + */ private Item item; - /** 数量 */ + /** + * 数量 + */ private Float quantity; - /** 仓库ID */ + /** + * 仓库ID + */ private Long deptId; - /** 创建人 */ + /** + * 创建人 + */ private String createBy; - /** 修改人 */ + /** + * 修改人 + */ private String updateBy; - /** 创建时间 */ + /** + * 创建时间 + */ private Timestamp createTime; - /** 修改时间 */ + /** + * 修改时间 + */ private Timestamp updateTime; -} \ No newline at end of file +} diff --git a/youchain-system/src/main/java/com/youchain/basicdata/service/dto/BigBomQueryCriteria.java b/youchain-system/src/main/java/com/youchain/basicdata/service/dto/BigBomQueryCriteria.java index 2601f0b..a1b4fff 100644 --- a/youchain-system/src/main/java/com/youchain/basicdata/service/dto/BigBomQueryCriteria.java +++ b/youchain-system/src/main/java/com/youchain/basicdata/service/dto/BigBomQueryCriteria.java @@ -1,29 +1,43 @@ /* -* Copyright 2019-2020 Zheng Jie -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright 2019-2020 Zheng Jie + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.youchain.basicdata.service.dto; import lombok.Data; + import java.util.List; + import com.youchain.annotation.Query; /** -* @website https://eladmin.vip -* @author shenyinan -* @date 2024-02-21 -**/ + * @author shenyinan + * @website https://eladmin.vip + * @date 2024-02-21 + **/ @Data -public class BigBomQueryCriteria{ -} \ No newline at end of file +public class BigBomQueryCriteria { + /** + * 物料编号 + */ + @Query(propName = "code", joinName = "item") + private String itemCode; + + /** + * + */ + @Query(propName = "code", joinName = "bigItem") + private String bigItemCode; + +} diff --git a/youchain-system/src/main/java/com/youchain/basicdata/service/dto/BigItemDto.java b/youchain-system/src/main/java/com/youchain/basicdata/service/dto/BigItemDto.java index 2803210..7f9aab6 100644 --- a/youchain-system/src/main/java/com/youchain/basicdata/service/dto/BigItemDto.java +++ b/youchain-system/src/main/java/com/youchain/basicdata/service/dto/BigItemDto.java @@ -15,6 +15,7 @@ */ package com.youchain.basicdata.service.dto; +import com.youchain.modules.system.service.dto.DeptSmallDto; import lombok.Data; import java.sql.Timestamp; import java.io.Serializable; @@ -43,7 +44,7 @@ public class BigItemDto implements Serializable { private String remark; /** 仓库ID */ - private Long deptId; + private DeptSmallDto dept; /** 创建人 */ private String createBy; @@ -56,4 +57,4 @@ public class BigItemDto implements Serializable { /** 修改时间 */ private Timestamp updateTime; -} \ No newline at end of file +} diff --git a/youchain-system/src/main/java/com/youchain/basicdata/service/dto/BigItemQueryCriteria.java b/youchain-system/src/main/java/com/youchain/basicdata/service/dto/BigItemQueryCriteria.java index 9f2f2e4..1109773 100644 --- a/youchain-system/src/main/java/com/youchain/basicdata/service/dto/BigItemQueryCriteria.java +++ b/youchain-system/src/main/java/com/youchain/basicdata/service/dto/BigItemQueryCriteria.java @@ -26,4 +26,11 @@ import com.youchain.annotation.Query; **/ @Data public class BigItemQueryCriteria{ -} \ No newline at end of file + /** 代码 */ + @Query(type = Query.Type.INNER_LIKE) + private String code; + + /** 名称 */ + @Query(type = Query.Type.INNER_LIKE) + private String name; +} diff --git a/youchain-system/src/main/java/com/youchain/basicdata/service/dto/PackageCheckDto.java b/youchain-system/src/main/java/com/youchain/basicdata/service/dto/PackageCheckDto.java new file mode 100644 index 0000000..a9a1c2d --- /dev/null +++ b/youchain-system/src/main/java/com/youchain/basicdata/service/dto/PackageCheckDto.java @@ -0,0 +1,82 @@ +/* + * Copyright 2019-2020 Zheng Jie + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.youchain.basicdata.service.dto; + +import com.youchain.modules.system.service.dto.DeptDto; +import com.youchain.modules.system.service.dto.DeptSmallDto; +import lombok.Data; + +import java.sql.Timestamp; +import java.io.Serializable; + +import com.alibaba.fastjson.annotation.JSONField; +import com.alibaba.fastjson.serializer.ToStringSerializer; + +/** + * @author huojin + * @website https://eladmin.vip + * @description / + * @date 2024-06-13 + **/ +@Data +public class PackageCheckDto implements Serializable { + + /** + * 防止精度丢失 + */ + @JSONField(serializeUsing = ToStringSerializer.class) + private Long id; + + /** + * 成套代码 + */ + private String code; + + /** + * 物料 + */ + private ItemDto item; + + /** + * 仓库 + */ + private DeptDto dept; + + /** + * 套数 + */ + private Double quantity; + + /** + * 创建人 + */ + private String createBy; + + /** + * 修改人 + */ + private String updateBy; + + /** + * 创建时间 + */ + private Timestamp createTime; + + /** + * 修改时间 + */ + private Timestamp updateTime; +} diff --git a/youchain-system/src/main/java/com/youchain/basicdata/service/dto/PackageCheckQueryCriteria.java b/youchain-system/src/main/java/com/youchain/basicdata/service/dto/PackageCheckQueryCriteria.java new file mode 100644 index 0000000..4b00629 --- /dev/null +++ b/youchain-system/src/main/java/com/youchain/basicdata/service/dto/PackageCheckQueryCriteria.java @@ -0,0 +1,42 @@ +/* + * Copyright 2019-2020 Zheng Jie + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.youchain.basicdata.service.dto; + +import lombok.Data; + +import java.util.List; + +import com.youchain.annotation.Query; + +/** + * @author huojin + * @website https://eladmin.vip + * @date 2024-06-13 + **/ +@Data +public class PackageCheckQueryCriteria { + /** + * 代码 + */ + @Query(type = Query.Type.INNER_LIKE) + private String code; + + /** + * 物料编号 + */ + @Query(propName = "code", joinName = "item") + private String itemCode; +} diff --git a/youchain-system/src/main/java/com/youchain/basicdata/service/impl/BigItemServiceImpl.java b/youchain-system/src/main/java/com/youchain/basicdata/service/impl/BigItemServiceImpl.java index 925d057..401a0c4 100644 --- a/youchain-system/src/main/java/com/youchain/basicdata/service/impl/BigItemServiceImpl.java +++ b/youchain-system/src/main/java/com/youchain/basicdata/service/impl/BigItemServiceImpl.java @@ -1,18 +1,18 @@ /* -* Copyright 2019-2020 Zheng Jie -* -* Licensed under the Apache License, Version 2.0 (the "License"); -* you may not use this file except in compliance with the License. -* You may obtain a copy of the License at -* -* http://www.apache.org/licenses/LICENSE-2.0 -* -* Unless required by applicable law or agreed to in writing, software -* distributed under the License is distributed on an "AS IS" BASIS, -* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -* See the License for the specific language governing permissions and -* limitations under the License. -*/ + * Copyright 2019-2020 Zheng Jie + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ package com.youchain.basicdata.service.impl; import com.youchain.basicdata.domain.BigItem; @@ -30,6 +30,7 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; + import java.util.List; import java.util.Map; import java.io.IOException; @@ -38,11 +39,11 @@ import java.util.ArrayList; import java.util.LinkedHashMap; /** -* @website https://eladmin.vip -* @description 服务实现 -* @author shenyinan -* @date 2024-02-21 -**/ + * @author shenyinan + * @website https://eladmin.vip + * @description 服务实现 + * @date 2024-02-21 + **/ @Service @RequiredArgsConstructor public class BigItemServiceImpl implements BigItemService { @@ -51,21 +52,21 @@ public class BigItemServiceImpl implements BigItemService { private final BigItemMapper bigItemMapper; @Override - public Map queryAll(BigItemQueryCriteria criteria, Pageable pageable){ - Page page = bigItemRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder),pageable); + public Map queryAll(BigItemQueryCriteria criteria, Pageable pageable) { + Page page = bigItemRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder), pageable); return PageUtil.toPage(page.map(bigItemMapper::toDto)); } @Override - public List queryAll(BigItemQueryCriteria criteria){ - return bigItemMapper.toDto(bigItemRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root,criteria,criteriaBuilder))); + public List queryAll(BigItemQueryCriteria criteria) { + return bigItemMapper.toDto(bigItemRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder))); } @Override @Transactional public BigItemDto findById(Long id) { BigItem bigItem = bigItemRepository.findById(id).orElseGet(BigItem::new); - ValidationUtil.isNull(bigItem.getId(),"BigItem","id",id); + ValidationUtil.isNull(bigItem.getId(), "BigItem", "id", id); return bigItemMapper.toDto(bigItem); } @@ -79,7 +80,7 @@ public class BigItemServiceImpl implements BigItemService { @Transactional(rollbackFor = Exception.class) public void update(BigItem resources) { BigItem bigItem = bigItemRepository.findById(resources.getId()).orElseGet(BigItem::new); - ValidationUtil.isNull( bigItem.getId(),"BigItem","id",resources.getId()); + ValidationUtil.isNull(bigItem.getId(), "BigItem", "id", resources.getId()); bigItem.copy(resources); bigItemRepository.save(bigItem); } @@ -95,12 +96,12 @@ public class BigItemServiceImpl implements BigItemService { public void download(List all, HttpServletResponse response) throws IOException { List> list = new ArrayList<>(); for (BigItemDto bigItem : all) { - Map map = new LinkedHashMap<>(); + Map map = new LinkedHashMap<>(); map.put("代码", bigItem.getCode()); map.put("名称", bigItem.getName()); map.put("类型", bigItem.getType()); map.put("备注", bigItem.getRemark()); - map.put("仓库ID", bigItem.getDeptId()); + map.put("仓库", bigItem.getDept().getName()); map.put("创建人", bigItem.getCreateBy()); map.put("修改人", bigItem.getUpdateBy()); map.put("创建时间", bigItem.getCreateTime()); @@ -109,4 +110,4 @@ public class BigItemServiceImpl implements BigItemService { } FileUtil.downloadExcel(list, response); } -} \ No newline at end of file +} diff --git a/youchain-system/src/main/java/com/youchain/basicdata/service/impl/PackageCheckServiceImpl.java b/youchain-system/src/main/java/com/youchain/basicdata/service/impl/PackageCheckServiceImpl.java new file mode 100644 index 0000000..d17ea5d --- /dev/null +++ b/youchain-system/src/main/java/com/youchain/basicdata/service/impl/PackageCheckServiceImpl.java @@ -0,0 +1,112 @@ +/* + * Copyright 2019-2020 Zheng Jie + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ +package com.youchain.basicdata.service.impl; + +import com.youchain.basicdata.domain.PackageCheck; +import com.youchain.utils.FileUtil; +import com.youchain.utils.PageUtil; +import com.youchain.utils.QueryHelp; +import com.youchain.utils.ValidationUtil; +import lombok.RequiredArgsConstructor; +import com.youchain.basicdata.repository.PackageCheckRepository; +import com.youchain.basicdata.service.PackageCheckService; +import com.youchain.basicdata.service.dto.PackageCheckDto; +import com.youchain.basicdata.service.dto.PackageCheckQueryCriteria; +import com.youchain.basicdata.service.mapstruct.PackageCheckMapper; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; + +import java.util.List; +import java.util.Map; +import java.io.IOException; +import javax.servlet.http.HttpServletResponse; +import java.util.ArrayList; +import java.util.LinkedHashMap; + +/** + * @author huojin + * @website https://eladmin.vip + * @description 服务实现 + * @date 2024-06-13 + **/ +@Service +@RequiredArgsConstructor +public class PackageCheckServiceImpl implements PackageCheckService { + + private final PackageCheckRepository packageCheckRepository; + private final PackageCheckMapper packageCheckMapper; + + @Override + public Map queryAll(PackageCheckQueryCriteria criteria, Pageable pageable) { + Page page = packageCheckRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder), pageable); + return PageUtil.toPage(page.map(packageCheckMapper::toDto)); + } + + @Override + public List queryAll(PackageCheckQueryCriteria criteria) { + return packageCheckMapper.toDto(packageCheckRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder))); + } + + @Override + @Transactional + public PackageCheckDto findById(Long id) { + PackageCheck packageCheck = packageCheckRepository.findById(id).orElseGet(PackageCheck::new); + ValidationUtil.isNull(packageCheck.getId(), "PackageCheck", "id", id); + return packageCheckMapper.toDto(packageCheck); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public PackageCheckDto create(PackageCheck resources) { + + return packageCheckMapper.toDto(packageCheckRepository.save(resources)); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(PackageCheck resources) { + PackageCheck packageCheck = packageCheckRepository.findById(resources.getId()).orElseGet(PackageCheck::new); + ValidationUtil.isNull(packageCheck.getId(), "PackageCheck", "id", resources.getId()); + packageCheck.copy(resources); + packageCheckRepository.save(packageCheck); + } + + @Override + public void deleteAll(Long[] ids) { + for (Long id : ids) { + packageCheckRepository.deleteById(id); + } + } + + @Override + public void download(List all, HttpServletResponse response) throws IOException { + List> list = new ArrayList<>(); + for (PackageCheckDto packageCheck : all) { + Map map = new LinkedHashMap<>(); + map.put("成套代码", packageCheck.getCode()); + map.put("物料", packageCheck.getItem().getCode()); + map.put("套数", packageCheck.getQuantity()); + map.put("创建人", packageCheck.getCreateBy()); + map.put("修改人", packageCheck.getUpdateBy()); + map.put("创建时间", packageCheck.getCreateTime()); + map.put("修改时间", packageCheck.getUpdateTime()); + list.add(map); + } + FileUtil.downloadExcel(list, response); + } +} diff --git a/youchain-system/src/main/java/com/youchain/basicdata/service/impl/StockServiceImpl.java b/youchain-system/src/main/java/com/youchain/basicdata/service/impl/StockServiceImpl.java index bf92f63..87ff8f6 100644 --- a/youchain-system/src/main/java/com/youchain/basicdata/service/impl/StockServiceImpl.java +++ b/youchain-system/src/main/java/com/youchain/basicdata/service/impl/StockServiceImpl.java @@ -274,14 +274,14 @@ public class StockServiceImpl implements StockService { @Override @Transactional(rollbackFor = Exception.class) public void bindContainer(String QRCode, String stockCode, String pointCode) { - Map map = parseString(QRCode); + Map map = parseString(QRCode);//解析二维码 String propC1 = map.get("Lot");//批次号 - String gdh = map.get("S");//工单号 + String boxNumber = map.get("S");//箱号 String propC3 = map.get("P");//工厂 String propD1 = map.get("D");//生产日期 double orderQty = Double.parseDouble(getStringCode(map.get("Q")));//数量 - if (asnDetailService.findByMo(QRCode)) { - throw new RuntimeException("该MO票已入库,请勿重复操作!"); + if (asnDetailService.existsByboxNumber(boxNumber)) { + throw new RuntimeException(boxNumber + "箱号已入库,请勿重复操作!"); } Item item = validateItem(getStringCode(map.get("M")));//验证物料 Stock stock = validateStock(stockCode);//验证容器 @@ -304,10 +304,10 @@ public class StockServiceImpl implements StockService { Point endPoint = validateEndPoint(item, areaName);//验证目标点位 checkPointStatus(srcPoint);//验证源点位状态 AgvTask agvTask = createAndSendAgvTask(BizStatus.ASN, stock, srcPoint, endPoint);//生成AGV任务 - AsnDetail asnDetail = asnDetailService.createAsnDetail(item, stock, srcPoint, propC1, gdh, propC3, Timestamp.valueOf(DateUtil.formatDateTime(DateUtil.parse(propD1))), orderQty, QRCode); + AsnDetail asnDetail = asnDetailService.createAsnDetail(item, stock, srcPoint, propC1, boxNumber, propC3, Timestamp.valueOf(DateUtil.formatDateTime(DateUtil.parse(propD1))), orderQty, QRCode); ItemKey itemKey = itemKeyService.getItemKey(item, asnDetail.getPropC1(), asnDetail.getOrderNumber());//生成Itemkey createTask(item, itemKey, asnDetail, stock, srcPoint, endPoint, agvTask);//生成Task任务 - updateStockAndPoints(stock, srcPoint, endPoint); + updateStockAndPoints(stock, srcPoint, endPoint);//更新容器和点位状态 } private void validateStockAndItem(Stock stock, Item item) { diff --git a/youchain-system/src/main/java/com/youchain/basicdata/service/mapstruct/PackageCheckMapper.java b/youchain-system/src/main/java/com/youchain/basicdata/service/mapstruct/PackageCheckMapper.java new file mode 100644 index 0000000..2669439 --- /dev/null +++ b/youchain-system/src/main/java/com/youchain/basicdata/service/mapstruct/PackageCheckMapper.java @@ -0,0 +1,32 @@ +/* +* Copyright 2019-2020 Zheng Jie +* +* Licensed under the Apache License, Version 2.0 (the "License"); +* you may not use this file except in compliance with the License. +* You may obtain a copy of the License at +* +* http://www.apache.org/licenses/LICENSE-2.0 +* +* Unless required by applicable law or agreed to in writing, software +* distributed under the License is distributed on an "AS IS" BASIS, +* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +* See the License for the specific language governing permissions and +* limitations under the License. +*/ +package com.youchain.basicdata.service.mapstruct; + +import com.youchain.base.BaseMapper; +import com.youchain.basicdata.domain.PackageCheck; +import com.youchain.basicdata.service.dto.PackageCheckDto; +import org.mapstruct.Mapper; +import org.mapstruct.ReportingPolicy; + +/** +* @website https://eladmin.vip +* @author huojin +* @date 2024-06-13 +**/ +@Mapper(componentModel = "spring", unmappedTargetPolicy = ReportingPolicy.IGNORE) +public interface PackageCheckMapper extends BaseMapper { + +} \ No newline at end of file diff --git a/youchain-system/src/main/java/com/youchain/businessdata/service/AsnDetailService.java b/youchain-system/src/main/java/com/youchain/businessdata/service/AsnDetailService.java index b30131a..d8e24a0 100644 --- a/youchain-system/src/main/java/com/youchain/businessdata/service/AsnDetailService.java +++ b/youchain-system/src/main/java/com/youchain/businessdata/service/AsnDetailService.java @@ -117,5 +117,10 @@ public interface AsnDetailService { */ AsnDetail createAsnDetail(Item item, Stock stock); - boolean findByMo(String Mo); + /** + * 根据Mo查找AsnDetail + * @param boxNumber + * @return + */ + boolean existsByboxNumber(String boxNumber); } diff --git a/youchain-system/src/main/java/com/youchain/businessdata/service/impl/AsnDetailServiceImpl.java b/youchain-system/src/main/java/com/youchain/businessdata/service/impl/AsnDetailServiceImpl.java index 9417c7a..777fe78 100644 --- a/youchain-system/src/main/java/com/youchain/businessdata/service/impl/AsnDetailServiceImpl.java +++ b/youchain-system/src/main/java/com/youchain/businessdata/service/impl/AsnDetailServiceImpl.java @@ -233,9 +233,10 @@ public class AsnDetailServiceImpl implements AsnDetailService { } @Override - public boolean findByMo(String Mo) { - String hql = " from AsnDetail ad where ad.po='" + Mo + "' "; + public boolean existsByboxNumber(String boxNumber) { + String hql = " from AsnDetail ad where ad.orderNumber=:boxNumber "; Query query = entityMapper.createQuery(hql); + query.setParameter("boxNumber", boxNumber); List asnDetailList = query.getResultList(); if (asnDetailList.size() > 0) { return true; diff --git a/youchain-system/src/main/java/com/youchain/utils/UserUtils.java b/youchain-system/src/main/java/com/youchain/utils/UserUtils.java index b0e8665..b67c409 100644 --- a/youchain-system/src/main/java/com/youchain/utils/UserUtils.java +++ b/youchain-system/src/main/java/com/youchain/utils/UserUtils.java @@ -19,7 +19,6 @@ public class UserUtils { }else{ dept.setId(0L); } - log.error(JSONUtil.toJsonStr("用户仓库ID:"+dept.getId())); return dept; } } diff --git a/youchain-system/src/main/resources/config/application.yml b/youchain-system/src/main/resources/config/application.yml index fe61839..52c9fe6 100644 --- a/youchain-system/src/main/resources/config/application.yml +++ b/youchain-system/src/main/resources/config/application.yml @@ -30,7 +30,7 @@ spring: redis: #数据库索引 - database: ${REDIS_DB:1} + database: ${REDIS_DB:2} #host: ${REDIS_HOST:115.159.67.99} #password: ${REDIS_PWD:123456} #port: ${REDIS_PORT:6380}