Commit 55eb71f3 by 李小惠

批量信息修改,记账

parent e6ca372d
......@@ -40,22 +40,27 @@ public class InventorySumDto {
* 位置名称
*/
private String locationName;
/**
*number 库存数量
*/
private Integer number;
/**
* 单价
*/
private BigDecimal unitPrice;
private String unit;
private String unitType;
/**
* 在库数
*/
private Integer stockNumber;
/**
*price 总价
*/
private BigDecimal price;
private String unit;
private String unitType;
/**
*number 库存数量
*/
private Integer number;
}
......@@ -21,7 +21,14 @@ public class OrderDetailDto implements Serializable {
private String supplierName;
/**
* 计划数量
*/
private Integer planNum;
/**
* 实际数量
*/
private Integer actualNum;
private BigDecimal price;
}
......@@ -54,7 +54,6 @@ public class OrderMainDto implements Serializable {
private String note;
private Date createTime;
//审核状态(审批状态)
private String examineState;
......@@ -76,4 +75,9 @@ public class OrderMainDto implements Serializable {
*/
private String returnUserId;
/**
* 附件地址
*/
private String attachmentLocation;
}
......@@ -7,6 +7,7 @@ import lombok.EqualsAndHashCode;
import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
......@@ -23,7 +24,7 @@ public class OrderDetailReq extends BaseRequest {
private String typeName;
private Long sizeId;
private String sizeId;
private String sizeName;
......@@ -46,4 +47,9 @@ public class OrderDetailReq extends BaseRequest {
private String createUser;
private String updateUser;
/**
* 修改后数量
*/
private Integer modifyQuantity;
}
......@@ -8,6 +8,7 @@ import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;
import java.util.List;
@Data
@EqualsAndHashCode(callSuper = true)
......@@ -55,11 +56,6 @@ public class OrderMainReq extends BaseRequest {
private String attachmentLocation;
private String invList;
// /**
// * 组织机构id
// */
// @NotNull(message = "组织机构不能为空",groups = {edit.class, add.class})
// private Long orgId;
/**
* 创建时间
......@@ -100,4 +96,6 @@ public class OrderMainReq extends BaseRequest {
* 归还人,归还入库特有
*/
private String returnUserId;
private List<OrderDetailReq> childrenOrder;
}
package com.junmp.jyzb.api.bean.query;
import com.baomidou.mybatisplus.annotation.TableField;
import com.junmp.v2.common.bean.request.BaseRequest;
import lombok.Data;
import lombok.EqualsAndHashCode;
......@@ -42,6 +41,31 @@ public class OrderUploadReq extends BaseRequest {
*/
private List<OrderUploadDetailReq> childrenOrder;
/**
* 记账人id
*/
private String updateUserId;
/**
* 记账人(修改人员)
*/
private String updateUser;
/**
* 组织机构id(出库单存放id)
*/
private Long startOrgId;
/**
* 组织机构id(入库单存放id)
*/
private Long endOrgId;
/**
* 单据类型(入库in,出库out)
*/
private String orderType;
@Getter
public class OrderUploadDetailReq{
/**
......@@ -53,6 +77,10 @@ public class OrderUploadReq extends BaseRequest {
*/
private Integer planNum;
/**
* 修改后数量
*/
private Integer modifyQuantity;
/**
* 实际数量
*/
private Integer actualNum;
......@@ -80,5 +108,9 @@ public class OrderUploadReq extends BaseRequest {
* 物资号型名称
*/
private String sizeName;
/**
* 价格
*/
private BigDecimal price;
}
}
package com.junmp.jyzb.api.bean.req;
import com.junmp.v2.common.bean.request.ValidationApi;
import lombok.Data;
import javax.validation.constraints.NotNull;
import java.util.Date;
import java.util.List;
@Data
public class BatchEditingInvsReq {
/**
* 组织机构id
*/
private Long orgId;
/**
*类型id
*/
private String typeId;
/**
*号型id
*/
private String sizeId;
/**
*仓库id
*/
private String locationId;
/**
*装备id
*/
private List<String> inventoryIdList;
/**
*生产日期
*/
private Date productionDate;
/**
*质保期
*/
private Integer warrantyPeriod;
/**
*维保期
*/
private Integer maintenancePeriod;
/**
*货架id
*/
private String shelfId;
/**
* 排
*/
private Integer shelfRanges;
/**
* 列
*/
private Integer shelfColumns;
/**
* 行
*/
private Integer shelfRows;
}
......@@ -13,7 +13,6 @@ public class UpdateShelfReq extends BaseRequest {
@NotBlank(message = "货架id不能为空",groups = {edit.class, delete.class})
private String shelfId;
@NotNull(message = "区域id不能为空",groups = {add.class})
private String areaId;
@NotBlank(message = "货架名称不能为空",groups = {add.class,edit.class})
......
......@@ -11,6 +11,7 @@ public enum OrderExceptionEnum implements IExceptionEnum {
ORDER_CAN_NOT_UPDATE(CommonConstant.DEFAULT_USER_ERROR_CODE,"进行中的单据或已完成的单据无法修改"),
ORDERDETAIL_ISNOT_NULL(CommonConstant.DEFAULT_USER_ERROR_CODE,"记账子单据不能为空"),
ORDERDETAIL_NOT_EXIST(CommonConstant.DEFAULT_USER_ERROR_CODE,"子单据不存在"),
ORDERDETAIL_ERROR(CommonConstant.DEFAULT_USER_ERROR_CODE,"子单据不一致,操作失败"),
;
/**
......
......@@ -2,6 +2,7 @@ package com.junmp.jyzb.controller;
import com.junmp.jyzb.api.bean.dto.*;
import com.junmp.jyzb.api.bean.query.*;
import com.junmp.jyzb.api.bean.req.BatchEditingInvsReq;
import com.junmp.jyzb.api.bean.req.EquipmentBindReq;
import com.junmp.jyzb.entity.Inventory;
import com.junmp.jyzb.entity.InventorySummary;
......@@ -199,7 +200,7 @@ public class InventoryController {
return ApiRes.success(inventoryService.GetListEquipment(req));
}
//根据条件查询仓库下的所有装备信息
//根据条件查询仓库下的所有装备信息(业务状态,在库状态,仓库id,超期状态)
@PostMapping("/GetDetailByTerms")
@ApiOperation("根据条件查询仓库下的所有装备信息")
public ApiRes<PageResult<InventoryDto>> GetDetailByTerms(@RequestBody @Validated(ValidationApi.export.class) InventoryReq req){
......@@ -209,13 +210,20 @@ public class InventoryController {
/**
* 根据查询条件,查询出库存中的装备信息汇总,出库单选择装备时使用该接口进行查询填写
*/
//根据组织机构orgId查询出该组织机构下的仓库id
//根据仓库id和orgId查询出库存中存在的装备typeId
//根据仓库id,orgId,type_id 查询出装备号型sizeId
//根据仓库id,orgId,typeId,sizeId查询出单价和对应的数量
@PostMapping("/GetInventorySumInfo")
@ApiOperation("通过条件查询出库存中的装备信息")
@ApiOperation("查询出库存中的装备信息")
public ApiRes<List<InventorySumDto>> GetInventorySumInfo(@RequestBody InventorySumReq req){
return ApiRes.success(inventorySummaryService.GetInventorySumInfo(req));
}
//批量信息修改(修改质保期,维保期,购入单价,生产日期,存放货架,货架位置)
@PostMapping("/BatchEditingInvsInfo")
@ApiOperation("批量信息修改")
public ApiRes<Boolean> BatchEditingInvsInfo(@RequestBody BatchEditingInvsReq req){
return ApiRes.success(inventoryService.BatchEditingInvsInfo(req));
}
}
......@@ -92,7 +92,7 @@ public class OrderController {
@PostMapping("/Accounting")
@ApiOperation("记账")
public ApiRes<Boolean> Accounting(@RequestBody @Validated(ValidationApi.delete.class) OrderUploadReq req){
public ApiRes<Boolean> Accounting(@RequestBody @Validated(ValidationApi.delete.class) OrderMainReq req){
return ApiRes.success(orderMainService.Accounting(req));
}
......
......@@ -57,6 +57,11 @@ public class OrderLog implements Serializable {
@TableField("update_user")
private String updateUser;
/**
* 组织机构id
*/
@TableField("org_id")
private Long orgId;
private static final long serialVersionUID = 1L;
......
......@@ -7,6 +7,7 @@ import com.junmp.jyzb.api.bean.dto.EqsBriefDto;
import com.junmp.jyzb.api.bean.dto.EqsSumDto;
import com.junmp.jyzb.api.bean.dto.InventoryDto;
import com.junmp.jyzb.api.bean.query.InventoryReq;
import com.junmp.jyzb.api.bean.req.BatchEditingInvsReq;
import com.junmp.jyzb.api.bean.vo.InventoryVo;
import com.junmp.jyzb.entity.Inventory;
import com.junmp.jyzb.entity.InventorySummary;
......@@ -59,5 +60,4 @@ public interface InventoryMapper extends BaseMapper<Inventory> {
IPage<InventorySummary> EqsByCabinetBoxIdPage(Page<InventorySummary> page, String id);
}
\ No newline at end of file
......@@ -4,7 +4,6 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.junmp.jyzb.api.bean.dto.InventorySumDto;
import com.junmp.jyzb.api.bean.query.InventorySumReq;
import com.junmp.jyzb.entity.InventorySummary;
import com.junmp.jyzb.entity.ProductBatch;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
......
......@@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.extension.service.IService;
import com.junmp.jyzb.api.bean.dto.*;
import com.junmp.jyzb.api.bean.query.*;
import com.junmp.jyzb.api.bean.req.BatchEditingInvsReq;
import com.junmp.jyzb.api.bean.req.EquipmentBindReq;
import com.junmp.jyzb.entity.Inventory;
import com.junmp.jyzb.entity.InventorySummary;
......@@ -82,5 +83,6 @@ public interface InventoryService extends IService<Inventory> {
//根据条件查询仓库下的所有装备信息
PageResult<InventoryDto> GetDetailByTerms(InventoryReq req);
//批量信息修改
boolean BatchEditingInvsInfo(BatchEditingInvsReq req);
}
......@@ -37,5 +37,5 @@ public interface OrderMainService extends IService<OrderMain> {
boolean PushState(OrderUploadReq req);
//记账
boolean Accounting(OrderUploadReq req);
boolean Accounting(OrderMainReq req);
}
......@@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.junmp.jyzb.api.bean.dto.*;
import com.junmp.jyzb.api.bean.query.*;
import com.junmp.jyzb.api.bean.req.BatchEditingInvsReq;
import com.junmp.jyzb.api.bean.req.EquipmentBindReq;
import com.junmp.jyzb.api.bean.vo.InventoryVo;
import com.junmp.jyzb.api.exception.enums.CabinetBoxExceptionEnum;
......@@ -351,7 +352,32 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
return PageResultFactory.createPageResult(page1);
}
//批量进行调整
@Override
@Transactional(rollbackFor = Exception.class)
public boolean BatchEditingInvsInfo(BatchEditingInvsReq req) {
//查询inventory表中数据,对响应数据进行修改
//判断是对整一类的装备进行修改还是说对个别几个装备进行批量修改
if (req.getInventoryIdList().size()!=0){
List<Inventory> list = list(new LambdaQueryWrapper<Inventory>().in(Inventory::getId, req.getInventoryIdList()));
if (list.size()==0){
throw new ServiceException(CabinetExceptionEnum.PARAMETER_ERROR);
}else {
//批量修改个别装备
List<Inventory> collect = list.stream().map(inventory -> {
Inventory inventory1 = new Inventory();
BeanPlusUtil.copyProperties(inventory, inventory1);
return inventory1;
}).collect(Collectors.toList());
return updateBatchById(collect);
}
}else {
List<Inventory> list = list(createWrapper(req));
//直接将一类的数据进行修改
return false;
}
}
//根据货架id获取装备列表汇总信息(list)
......@@ -558,4 +584,17 @@ public class InventoryServiceImpl extends ServiceImpl<InventoryMapper, Inventory
return map;
}
//创建条件查询
public LambdaQueryWrapper<Inventory> createWrapper(BatchEditingInvsReq req){
LambdaQueryWrapper<Inventory> wrapper = new LambdaQueryWrapper<>();
if (ObjectUtil.isEmpty(req)){
return wrapper;
}
wrapper.eq(ObjectUtil.isNotNull(req.getOrgId()),Inventory::getOrgId,req.getOrgId());
wrapper.eq(ObjectUtil.isNotNull(req.getLocationId()),Inventory::getLocationId,req.getLocationId());
wrapper.eq(ObjectUtil.isNotNull(req.getSizeId()),Inventory::getSizeId,req.getSizeId());
wrapper.eq(ObjectUtil.isNotNull(req.getTypeId()),Inventory::getTypeId,req.getTypeId());
return wrapper;
}
}
\ No newline at end of file
......@@ -38,8 +38,7 @@
</sql>
<select id="getLocationInventory" resultType="Map">
<select id="getLocationInventory" resultType="Map">
select
id,
<if test="queryType == 'org'">
......
......@@ -41,7 +41,7 @@
,bis.size_id,max(bis.size_name) as size_name
</if>
<if test="req.sizeId !=null and req.sizeId != ''">
,bis.unit_price
,bis.unit_price,max(bis.stock_number) as stock_number
</if>
FROM base_inventory_summary bis
join base_equipment_type bet on bet.id = bis.type_id
......@@ -67,42 +67,7 @@
</if>
</select>
<!-- <select id="GetInventorySumInfo" resultType="com.junmp.jyzb.api.bean.dto.InventorySumDto"-->
<!-- parameterType="com.junmp.jyzb.api.bean.query.InventorySumReq">-->
<!-- select bis.location_id as locationId,max(bis.location_name) as locationName-->
<!-- <if test="req.locationId !=null and req.locationId != ''">-->
<!-- ,bis.type_id as typeId,max(bis.type_name) as typeName,bet.unit,bet.unit_type as unitType-->
<!-- </if>-->
<!-- <if test="req.typeId != null and req.typeId != ''">-->
<!-- ,bis.size_id as sizeId,max(bis.size_name) as sizeName-->
<!-- </if>-->
<!-- <if test="req.sizeId !=null and req.sizeId != ''">-->
<!-- ,bis.unit_price as unitPrice-->
<!-- </if>-->
<!-- FROM base_inventory_summary bis-->
<!-- join base_equipment_type bet on bet.id = bis.type_id-->
<!-- where org_id_int =#{req.orgId}-->
<!-- <if test="req.locationId !=null and req.locationId != ''">-->
<!-- and location_id=#{req.locationId}-->
<!-- </if>-->
<!-- <if test="req.typeId != null and req.typeId != ''">-->
<!-- and type_id=#{req.typeId}-->
<!-- </if>-->
<!-- <if test="req.sizeId !=null and req.sizeId != ''">-->
<!-- and size_id=#{req.sizeId}-->
<!-- </if>-->
<!-- GROUP BY bis.location_id-->
<!-- <if test="req.locationId !=null and req.locationId != ''">-->
<!-- ,bis.type_id-->
<!-- </if>-->
<!-- <if test="req.typeId != null and req.typeId != ''">-->
<!-- ,bis.size_id-->
<!-- </if>-->
<!-- <if test="req.sizeId !=null and req.sizeId != ''">-->
<!-- ,bis.unit_price-->
<!-- </if>-->
<!-- </select>-->
</mapper>
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论