订单相关问题修复

This commit is contained in:
liux 2026-01-16 14:53:42 +08:00
parent e1c8a70723
commit a5cf4725b7
5 changed files with 63 additions and 21 deletions

View File

@ -71,6 +71,14 @@ public class ReportInventoryBaseController extends BaseController {
return getDataTable(list);
}
@PostMapping({"/out_into/flowing/page/exprot"})
@ApiOperation("出入库数据导出")
public void pageInventoryOutIntoFlowingExport(@Valid ReportInventoryOutDetailParam content,HttpServletResponse response) {
List<ReportInventoryOutDetailVO> list = reportInventoryBaseService.pageInventoryOutIntoFlowing(content);
ExcelUtil<ReportInventoryOutDetailVO> util = new ExcelUtil<ReportInventoryOutDetailVO>(ReportInventoryOutDetailVO.class);
util.exportExcel(response, list, "出入库流水");
}
@GetMapping({"/out_into/statistics/page"})
@ApiOperation("出入库流水")
public TableDataInfo pageInventoryOutIntoStatistics( ReportInventoryOutDetailParam content) {

View File

@ -433,7 +433,7 @@ public class OrderGoodsServiceImpl implements IOrderGoodsService {
String type = orderSheet2VO.getType();
BigDecimal orderNum = orderSheet2VO.getOrderNum();
Long singlePrice = orderSheet2VO.getSinglePrice();
Long totalPrice = orderSheet2VO.getTotalPrice()==0?null:orderSheet2VO.getTotalPrice();
Long totalPrice = orderSheet2VO.getTotalPrice()==0?0:orderSheet2VO.getTotalPrice();
if(type ==null){
sb.append(" 商品类别不能为空,请填写原料或商品!");
@ -461,18 +461,18 @@ public class OrderGoodsServiceImpl implements IOrderGoodsService {
CookMaterial cookMaterial = null;
CookMaterialType cookMaterialType = cookMaterialTypeMapper.selectCookMaterialTypeByMaterialTypeNameAndParentId(materialTypeName,parentId);
if(cookMaterialType ==null){
sb.append(" 类别缺失【"+materialTypeName+"】,请先添加");
sb.append(" 类别缺失【"+materialTypeName+"】,请先添加类别 '"+orderSheet2VO.getMaterialTypeName()+"'");
tf = false;
}else {
cookMaterial = cookMaterialMapper.selectCookMaterialByNameAndTypeIdAndType(materialName,cookMaterialType.getMaterialTypeId(),type);
}
if(cookMaterial == null){
sb.append(" 原料或商品缺失【"+materialName+"】,请添加");
sb.append(" 原料或商品缺失【"+materialName+"】,请添加原料或商品 '"+orderSheet2VO.getMaterialName()+"'");
tf = false;
}
ImsUnit imsUnit = imsUnitMapper.selectImsUnitByUnitName(unitName);
if(imsUnit ==null){
sb.append(" 单位缺失【"+materialName+"】,请添加");
sb.append(" 单位缺失【"+materialName+"】,请添加单位 "+orderSheet2VO.getUnitName()+"'");
tf = false;
}
if(orderNum ==null){
@ -487,18 +487,21 @@ public class OrderGoodsServiceImpl implements IOrderGoodsService {
sb.append(" 总价不能为空,请添加");
tf = false;
}
if(BigDecimal.valueOf(totalPrice).compareTo(orderNum.multiply(BigDecimal.valueOf(singlePrice))) !=0){
sb.append(materialName+" 总价不等于数量*单价,请检查");
tf = false;
if(totalPrice !=0L && singlePrice !=0L){
if(BigDecimal.valueOf(totalPrice).compareTo(orderNum.multiply(BigDecimal.valueOf(singlePrice))) !=0){
sb.append(materialName+" 总价不等于数量*单价,请检查");
tf = false;
}
}
if(tf){
OrderGoodsDetailAdd orderGoodsDetailAdd = new OrderGoodsDetailAdd();
BeanUtil.copyProperties(orderSheet2VO, orderGoodsDetailAdd);
orderGoodsDetailAdd.setMaterialId(cookMaterial.getMaterialId());
orderGoodsDetailAdd.setUnitId(imsUnit.getUnitId());
orderGoodsDetailAdd.setOrderNum(orderNum);
orderGoodsDetailAdd.setSinglePrice(singlePrice*100);
orderGoodsDetailAdd.setTotalPrice((totalPrice*100));
orderGoodsDetailAdd.setSinglePrice(singlePrice);
orderGoodsDetailAdd.setTotalPrice((totalPrice));
orderGoodsDetailList.add(orderGoodsDetailAdd);
materialIds.add(cookMaterial.getMaterialId());

View File

@ -35,16 +35,17 @@ public class OrderSheet2VO {
@ApiModelProperty(value = "计量单位id")
private String unitName;
/** 订货数量 */
@Excel(name = "订货数量")
@ApiModelProperty(value = "订货数量")
private BigDecimal orderNum;
/** 单价 */
@Excel(name = "单价")
@ApiModelProperty(value = "单价")
private Long singlePrice;
/** 订货数量 */
@Excel(name = "订货数量")
@ApiModelProperty(value = "订货数量")
private BigDecimal orderNum;
/** 总金额 */
@Excel(name = "总金额")
@ApiModelProperty(value = "总金额")

View File

@ -4,6 +4,7 @@ import com.alibaba.excel.annotation.ExcelIgnore;
import com.alibaba.excel.annotation.ExcelProperty;
import com.bonus.canteen.core.ims.converter.CustomNumberConverter;
import com.bonus.canteen.core.ims.converter.OutTypeConverter;
import com.bonus.common.core.annotation.Excel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@ -16,51 +17,65 @@ import java.time.LocalDateTime;
@Data
public class ReportInventoryOutDetailVO {
@ApiModelProperty("货品id")
@ExcelIgnore
private Long materialId;
@ApiModelProperty("货品名称")
@ExcelProperty({"货品名称"})
private String materialName;
@ApiModelProperty("货品编码")
@ExcelProperty({"货品编码"})
@Excel(name = "货品编码", type = Excel.Type.EXPORT)
private String materialCode;
@ApiModelProperty("货品名称")
@ExcelProperty({"货品名称"})
@Excel(name = "货品名称", type = Excel.Type.EXPORT)
private String materialName;
@ApiModelProperty("货品类别id")
@ExcelIgnore
private Long materialTypeId;
@ApiModelProperty("货品类别")
@ExcelProperty({"货品类别"})
@Excel(name = "货品类别", type = Excel.Type.EXPORT)
private String materialTypeName;
@ApiModelProperty("计量单位id")
@ExcelIgnore
private Long unitId;
private String size;
@ApiModelProperty("计量单位")
@ExcelProperty({"计量单位"})
@Excel(name = "计量单位", type = Excel.Type.EXPORT)
private String unitName;
@ApiModelProperty("单价")
@ExcelProperty(
value = {"单价(元)"},
converter = CustomNumberConverter.class
)
@Excel(name = "计量单位(元)", type = Excel.Type.EXPORT)
private BigDecimal unitPrice;
@ApiModelProperty("所属区域")
@ExcelProperty({"所属区域"})
@Excel(name = "所属区域", type = Excel.Type.EXPORT)
private String areaName;
@ApiModelProperty("仓库Id")
@ExcelIgnore
private String warehouseId;
@ApiModelProperty("仓库")
@ExcelProperty({"货品仓库"})
@Excel(name = "货品仓库", type = Excel.Type.EXPORT)
private String warehouseName;
@ApiModelProperty("出库类型")
private String supplierId;
private String supplierName;
@ApiModelProperty("出入库类型")
@ExcelProperty(value = {"出入库类型"},converter = OutTypeConverter.class)
@Excel(name = "出入库类型", type = Excel.Type.EXPORT,readConverterExp="1=领取出库,2=报损出库,3=退货出库,4=调拨出库,5=即入即出,6=超市出库,7=盘点出库")
private Integer outType;
@ApiModelProperty("类型 1入库 2出库")
@ -68,16 +83,22 @@ public class ReportInventoryOutDetailVO {
@ApiModelProperty("日期")
@ExcelProperty({"出库时间"})
@Excel(name = "出库时间", type = Excel.Type.EXPORT)
private LocalDateTime outDate;
@ApiModelProperty("出库数量")
@ExcelProperty({"出库数量"})
@Excel(name = "出库数量", type = Excel.Type.EXPORT)
private BigDecimal outNum;
@ApiModelProperty("出库金额")
@ExcelProperty(
value = {"出库金额(元)"},
converter = CustomNumberConverter.class
)
@Excel(name = "出库金额(元)", type = Excel.Type.EXPORT)
private BigDecimal outAmount;
// @ApiModelProperty("结存数量")
// @ExcelProperty({"结存数量"})
// private BigDecimal balanceCount;
@ -91,17 +112,25 @@ public class ReportInventoryOutDetailVO {
@ExcelIgnore
private String userId;
private String fetchUserId;
@ApiModelProperty("领料人")
@ExcelProperty({"领料人"})
@Excel(name = "领料人", type = Excel.Type.EXPORT)
private String fetchUserName;
@ApiModelProperty("生产日期")
@ExcelProperty({"生产日期"})
@Excel(name = "生产日期", type = Excel.Type.EXPORT)
private LocalDate productDate;
@ApiModelProperty("过期日期")
@ExcelProperty({"过期日期"})
@Excel(name = "过期日期", type = Excel.Type.EXPORT)
private LocalDate expireTime;
@ApiModelProperty("出库单号")
@ExcelProperty({"出库单号"})
@Excel(name = "出库单号", type = Excel.Type.EXPORT)
private String recordId;
}

View File

@ -20,6 +20,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
metabolism,
fatLevel,
bodyAge,
muscle,
bodyFat
from kitchen_staff_physical_examination
where 1=1