基础资料优化调整
parent
82c5ba51c0
commit
023be453bf
|
|
@ -16,19 +16,21 @@
|
|||
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 shenyinan
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author shenyinan
|
||||
* @date 2024-02-21
|
||||
**/
|
||||
@Entity
|
||||
|
|
@ -58,9 +60,10 @@ 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) {
|
||||
|
|
|
|||
|
|
@ -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));
|
||||
}
|
||||
}
|
||||
|
|
@ -20,15 +20,16 @@ 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 dengjiangkun
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author dengjiangkun
|
||||
* @date 2023-12-15
|
||||
**/
|
||||
@Entity
|
||||
|
|
|
|||
|
|
@ -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<PackageCheck, Long>, JpaSpecificationExecutor<PackageCheck> {
|
||||
/**
|
||||
* 根据 Code 查询
|
||||
* @param code /
|
||||
* @return /
|
||||
*/
|
||||
PackageCheck findByCode(String code);
|
||||
}
|
||||
|
|
@ -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<Object> createAgvScene(@Validated @RequestBody AgvScene resources){
|
||||
resources.setDept(UserUtils.getDept());
|
||||
return new ResponseEntity<>(agvSceneService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<Object> createBigBom(@Validated @RequestBody BigBom resources){
|
||||
resources.setDept(UserUtils.getDept());
|
||||
return new ResponseEntity<>(bigBomService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ 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,12 +28,13 @@ 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
|
||||
* @website https://eladmin.vip
|
||||
* @date 2024-02-21
|
||||
**/
|
||||
@RestController
|
||||
|
|
@ -68,6 +70,7 @@ public class BigItemController {
|
|||
@ApiOperation("新增bigitem")
|
||||
@PreAuthorize("@el.check('bigItem:add')")
|
||||
public ResponseEntity<Object> createBigItem(@Validated @RequestBody BigItem resources) {
|
||||
resources.setDept(UserUtils.getDept());
|
||||
return new ResponseEntity<>(bigItemService.create(resources), HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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<Object> createBillType(@Validated @RequestBody BillType resources){
|
||||
resources.setDept(UserUtils.getDept());
|
||||
return new ResponseEntity<>(billTypeService.create(resources),HttpStatus.CREATED);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -50,10 +50,6 @@ public class BoxController {
|
|||
|
||||
private final BoxService boxService;
|
||||
|
||||
private final CodeUtils codeUtils;
|
||||
|
||||
|
||||
|
||||
@Log("导出数据")
|
||||
@ApiOperation("导出数据")
|
||||
@GetMapping(value = "/download")
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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<Object> 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<Object> 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<Object> 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<Object> deletePackageCheck(@RequestBody Long[] ids) {
|
||||
packageCheckService.deleteAll(ids);
|
||||
return new ResponseEntity<>(HttpStatus.OK);
|
||||
}
|
||||
}
|
||||
|
|
@ -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<String,Object>
|
||||
*/
|
||||
Map<String,Object> queryAll(PackageCheckQueryCriteria criteria, Pageable pageable);
|
||||
|
||||
/**
|
||||
* 查询所有数据不分页
|
||||
* @param criteria 条件参数
|
||||
* @return List<PackageCheckDto>
|
||||
*/
|
||||
List<PackageCheckDto> 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<PackageCheckDto> all, HttpServletResponse response) throws IOException;
|
||||
}
|
||||
|
|
@ -18,13 +18,14 @@ 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;
|
||||
|
||||
/**
|
||||
* @author shenyinan
|
||||
* @website https://eladmin.vip
|
||||
* @description /
|
||||
* @author shenyinan
|
||||
* @date 2024-02-21
|
||||
**/
|
||||
@Data
|
||||
|
|
@ -32,27 +33,43 @@ 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;
|
||||
}
|
||||
|
|
@ -16,14 +16,28 @@
|
|||
package com.youchain.basicdata.service.dto;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.youchain.annotation.Query;
|
||||
|
||||
/**
|
||||
* @website https://eladmin.vip
|
||||
* @author shenyinan
|
||||
* @website https://eladmin.vip
|
||||
* @date 2024-02-21
|
||||
**/
|
||||
@Data
|
||||
public class BigBomQueryCriteria {
|
||||
/**
|
||||
* 物料编号
|
||||
*/
|
||||
@Query(propName = "code", joinName = "item")
|
||||
private String itemCode;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
@Query(propName = "code", joinName = "bigItem")
|
||||
private String bigItemCode;
|
||||
|
||||
}
|
||||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -26,4 +26,11 @@ import com.youchain.annotation.Query;
|
|||
**/
|
||||
@Data
|
||||
public class BigItemQueryCriteria{
|
||||
/** 代码 */
|
||||
@Query(type = Query.Type.INNER_LIKE)
|
||||
private String code;
|
||||
|
||||
/** 名称 */
|
||||
@Query(type = Query.Type.INNER_LIKE)
|
||||
private String name;
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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;
|
||||
}
|
||||
|
|
@ -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,9 +39,9 @@ import java.util.ArrayList;
|
|||
import java.util.LinkedHashMap;
|
||||
|
||||
/**
|
||||
* @author shenyinan
|
||||
* @website https://eladmin.vip
|
||||
* @description 服务实现
|
||||
* @author shenyinan
|
||||
* @date 2024-02-21
|
||||
**/
|
||||
@Service
|
||||
|
|
@ -100,7 +101,7 @@ public class BigItemServiceImpl implements BigItemService {
|
|||
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());
|
||||
|
|
|
|||
|
|
@ -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<String, Object> queryAll(PackageCheckQueryCriteria criteria, Pageable pageable) {
|
||||
Page<PackageCheck> page = packageCheckRepository.findAll((root, criteriaQuery, criteriaBuilder) -> QueryHelp.getPredicate(root, criteria, criteriaBuilder), pageable);
|
||||
return PageUtil.toPage(page.map(packageCheckMapper::toDto));
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<PackageCheckDto> 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<PackageCheckDto> all, HttpServletResponse response) throws IOException {
|
||||
List<Map<String, Object>> list = new ArrayList<>();
|
||||
for (PackageCheckDto packageCheck : all) {
|
||||
Map<String, Object> 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);
|
||||
}
|
||||
}
|
||||
|
|
@ -274,14 +274,14 @@ public class StockServiceImpl implements StockService {
|
|||
@Override
|
||||
@Transactional(rollbackFor = Exception.class)
|
||||
public void bindContainer(String QRCode, String stockCode, String pointCode) {
|
||||
Map<String, String> map = parseString(QRCode);
|
||||
Map<String, String> 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) {
|
||||
|
|
|
|||
|
|
@ -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<PackageCheckDto, PackageCheck> {
|
||||
|
||||
}
|
||||
|
|
@ -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);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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<AsnDetail> asnDetailList = query.getResultList();
|
||||
if (asnDetailList.size() > 0) {
|
||||
return true;
|
||||
|
|
|
|||
|
|
@ -19,7 +19,6 @@ public class UserUtils {
|
|||
}else{
|
||||
dept.setId(0L);
|
||||
}
|
||||
log.error(JSONUtil.toJsonStr("用户仓库ID:"+dept.getId()));
|
||||
return dept;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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}
|
||||
|
|
|
|||
Loading…
Reference in New Issue