发货需求

This commit is contained in:
王帅 2025-06-09 14:18:29 +08:00
parent 10c5b5f22a
commit f4717672de
24 changed files with 478 additions and 37 deletions

View File

@ -77,9 +77,9 @@ public class TmsIogisticsPrice implements Serializable {
@Excel(name = "公里数", width = 15)
@ApiModelProperty(value = "公里数")
private java.lang.Integer kilometers;
/**型*/
@Excel(name = "", width = 15)
@ApiModelProperty(value = "")
/**运输类型*/
@Excel(name = "运输类", width = 15)
@ApiModelProperty(value = "运输类")
private java.lang.String carType;
/**车长*/
@Excel(name = "车长", width = 15)
@ -126,4 +126,10 @@ public class TmsIogisticsPrice implements Serializable {
/**托数*/
@TableField(exist = false)
private java.lang.Integer maxPallets;
/**失效日期*/
@Excel(name = "失效日期", width = 15, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "失效日期")
private java.util.Date failureTime;
}

View File

@ -8,6 +8,6 @@
and a.car_long = b.car_long
where a.start_city = #{pickUpHub}
and a.target_city = #{deliveryAddress}
and (a.EFFECTIVE_DATE + a.VALIDITY) >= TRUNC(SYSDATE)
and a.failureTime >= TRUNC(SYSDATE)
</select>
</mapper>

View File

@ -48,9 +48,9 @@ public class VehiclePallet implements Serializable {
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "更新日期")
private java.util.Date updateTime;
/**型*/
@Excel(name = "", width = 15)
@ApiModelProperty(value = "")
/**运输类型*/
@Excel(name = "运输类", width = 15)
@ApiModelProperty(value = "运输类")
private java.lang.String carType;
/**车长*/
@Excel(name = "车长", width = 15)

View File

@ -14,5 +14,5 @@ import com.baomidou.mybatisplus.core.mapper.BaseMapper;
*/
public interface TmsVehicleProductMapper extends BaseMapper<TmsVehicleProduct> {
Integer getQty(@Param("pn") String pn, @Param("spec") String spec);
Integer getQty(@Param("pn") String pn);
}

View File

@ -5,6 +5,6 @@
<select id="getQty" resultType="java.lang.Integer"
parameterType="org.jeecg.modules.tms.basicdata.vehicleproduct.entity.TmsVehicleProduct">
select QTY_PER_TON from TMS_VEHICLE_PRODUCT
where pn = #{pn} and spec = #{spec}
where pn = #{pn}
</select>
</mapper>

View File

@ -231,6 +231,16 @@ public class DeliveryPlanController extends JeecgController<DeliveryPlan, IDeliv
return Result.OK(strings);
}
/**
* 入库单
* @return
*/
@GetMapping(value = "/getPo")
public Result<?> getByPo() {
List<String> strings = deliveryPlanService.getPo();
return Result.OK(strings);
}
/**
* 获取送货计划信息
* @param id

View File

@ -16,4 +16,5 @@ import org.jeecg.modules.tms.carinout.deliveryplandetail.entity.DeliveryPlanDeta
public interface DeliveryPlanMapper extends BaseMapper<DeliveryPlan> {
List<DeliveryPlanDetail> getByPo(@Param("po") String po);
List<String> getPo();
}

View File

@ -9,5 +9,13 @@
left join MATERIALRECEIVEREQUESTDETAIL b
on a.RECEIVEREQUESTNAME = b.RECEIVEREQUESTNAME
where a.RECEIVEREQUESTNAME = #{po}
and a.SITENAME = 'SDK'
and a.RECEIVEREQUESTSTATE = 'Created'
</select>
<select id="getPo" resultType="java.lang.String">
select RECEIVEREQUESTNAME from MATERIALRECEIVEREQUEST
where SITENAME = 'SDK'
and RECEIVEREQUESTSTATE = 'Created'
</select>
</mapper>

View File

@ -15,4 +15,6 @@ import java.util.List;
public interface IDeliveryPlanService extends IService<DeliveryPlan> {
List<DeliveryPlanDetail> getByPo(String po);
List<String> getPo();
}

View File

@ -29,4 +29,10 @@ public class DeliveryPlanServiceImpl extends ServiceImpl<DeliveryPlanMapper, Del
public List<DeliveryPlanDetail> getByPo(String po) {
return deliveryPlanMapper.getByPo(po);
}
@DS("wms")
@Override
public List<String> getPo() {
return deliveryPlanMapper.getPo();
}
}

View File

@ -9,6 +9,8 @@ import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
@ -174,4 +176,11 @@ public class DeliveryPlanDetailController extends JeecgController<DeliveryPlanDe
return super.importExcel(request, response, DeliveryPlanDetail.class);
}
@GetMapping(value = "/getByDeliveryPlanId")
public Result<?> getByPo(String id) {
LambdaQueryWrapper<DeliveryPlanDetail> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(DeliveryPlanDetail::getDeliveryPlanId, id);
List<DeliveryPlanDetail> list = deliveryPlanDetailService.list(lambdaQueryWrapper);
return Result.OK(list);
}
}

View File

@ -211,11 +211,12 @@ public class VehicleInOutController extends JeecgController<VehicleInOut, IVehic
return Result.error("已经进行过送货了!");
}
}
vehicleInOut.setVehicleDemandCountId(vehicleInOut.getId());
vehicleInOut.setId(null)
.setCreateTime(null)
.setCreateBy(null)
.setCurrentStatus("1");
.setCurrentStatus("1")
.setPo(vehicleInOut.getPo())
.setVehicleDemandCountId(vehicleInOut.getId());
vehicleInOutService.save(vehicleInOut);
return Result.OK("提货成功!");
}

View File

@ -18,7 +18,6 @@ import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.tms.carinout.vehicleinout.entity.VehicleParam;
import org.jeecg.modules.tms.outbound.deliverydemand.entity.DeliveryDemand;
import org.jeecg.modules.tms.outbound.deliverydemand.entity.DeliveryDemandDetail;
import org.jeecg.modules.tms.outbound.deliverydemand.service.IDeliveryDemandService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
@ -26,6 +25,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecg.modules.tms.outbound.deliverydemanddetail.entity.DeliveryDemandDetail;
import org.jeecg.modules.tms.outbound.deliverydemanddetail.service.IDeliveryDemandDetailService;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
@ -33,6 +34,7 @@ import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
@ -55,6 +57,8 @@ import org.jeecg.common.aspect.annotation.AutoLog;
public class DeliveryDemandController extends JeecgController<DeliveryDemand, IDeliveryDemandService> {
@Autowired
private IDeliveryDemandService deliveryDemandService;
@Autowired
private IDeliveryDemandDetailService deliveryDemandDetailService;
/**
* 分页列表查询
@ -101,8 +105,14 @@ public class DeliveryDemandController extends JeecgController<DeliveryDemand, ID
@ApiOperation(value="发货需求-添加", notes="发货需求-添加")
//@RequiresPermissions("org.jeecg.modules.tms:tms_delivery_demand:add")
@PostMapping(value = "/add")
@Transactional(rollbackFor = Exception.class)
public Result<String> add(@RequestBody DeliveryDemand deliveryDemand) {
deliveryDemandService.save(deliveryDemand);
List<DeliveryDemandDetail> deliveryDemandDetailList = deliveryDemand.getDeliveryDemandDetailList();
deliveryDemandDetailList.forEach(item ->{
item.setDeliveryDemandId(deliveryDemand.getId());
});
deliveryDemandDetailService.saveBatch(deliveryDemandDetailList);
return Result.OK("添加成功!");
}
@ -114,10 +124,16 @@ public class DeliveryDemandController extends JeecgController<DeliveryDemand, ID
*/
@AutoLog(value = "发货需求-编辑")
@ApiOperation(value="发货需求-编辑", notes="发货需求-编辑")
@Transactional(rollbackFor = Exception.class)
//@RequiresPermissions("org.jeecg.modules.tms:tms_delivery_demand:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody DeliveryDemand deliveryDemand) {
deliveryDemandService.updateById(deliveryDemand);
List<DeliveryDemandDetail> deliveryDemandDetailList = deliveryDemand.getDeliveryDemandDetailList();
deliveryDemandDetailList.forEach(item ->{
item.setDeliveryDemandId(deliveryDemand.getId());
});
deliveryDemandDetailService.saveOrUpdateBatch(deliveryDemandDetailList);
return Result.OK("编辑成功!");
}
@ -205,12 +221,12 @@ public class DeliveryDemandController extends JeecgController<DeliveryDemand, ID
/**
* 根据料号规格发货数量计算托盘数
* @param deliveryDemand
* @param deliveryDemands
* @return
*/
@PostMapping("/getPalletsNum")
public Result<?> getPalletsNum(@RequestBody DeliveryDemand deliveryDemand) {
return deliveryDemandService.getPalletsNum(deliveryDemand);
public Result<?> getPalletsNum(@RequestBody List<DeliveryDemand> deliveryDemands) {
return deliveryDemandService.getPalletsNum(deliveryDemands);
}
/**
@ -249,4 +265,14 @@ public class DeliveryDemandController extends JeecgController<DeliveryDemand, ID
List<String> strings = deliveryDemandService.getShip();
return Result.OK(strings);
}
/**
* 获取发货明细
* @return
*/
@GetMapping(value = "/getShipDetail")
public Result<?> getShipDetail(String invoice) {
List<DeliveryDemandDetail> demandDetails = deliveryDemandService.getShipDetail(invoice);
return Result.OK(demandDetails);
}
}

View File

@ -4,12 +4,12 @@ import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableLogic;
import java.util.List;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.jeecg.modules.tms.outbound.deliverydemanddetail.entity.DeliveryDemandDetail;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
@ -61,11 +61,11 @@ public class DeliveryDemand implements Serializable {
@ApiModelProperty(value = "发货类型")
private java.lang.String shipType;
/**料号*/
@Excel(name = "料号", width = 15)
// @Excel(name = "料号", width = 15)
@ApiModelProperty(value = "料号")
private java.lang.String pn;
/**规格*/
@Excel(name = "规格", width = 15)
// @Excel(name = "规格", width = 15)
@ApiModelProperty(value = "规格")
private java.lang.String spec;
/**发货数量*/
@ -73,7 +73,7 @@ public class DeliveryDemand implements Serializable {
@ApiModelProperty(value = "发货数量")
private java.lang.Integer shipNumber;
/**单位*/
@Excel(name = "单位", width = 15, dicCode = "unit")
// @Excel(name = "单位", width = 15, dicCode = "unit")
@Dict(dicCode = "unit")
@ApiModelProperty(value = "单位")
private java.lang.String unit;
@ -87,6 +87,12 @@ public class DeliveryDemand implements Serializable {
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "发货时间")
private java.util.Date shipDate;
/**到货时间*/
@Excel(name = "到货时间", width = 20, format = "yyyy-MM-dd")
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd")
@DateTimeFormat(pattern="yyyy-MM-dd")
@ApiModelProperty(value = "到货时间")
private java.util.Date deliveryDate;
/**送货地点*/
@Excel(name = "送货地点", width = 15, dicCode = "delivery_address")
@Dict(dicCode = "delivery_address")
@ -98,11 +104,11 @@ public class DeliveryDemand implements Serializable {
@ApiModelProperty(value = "取货仓库")
private java.lang.String pickUpHub;
/**发货单*/
@Excel(name = "发货单", width = 15)
// @Excel(name = "发货单", width = 15)
@ApiModelProperty(value = "发货单")
private java.lang.String invoice;
/**销售人员*/
@Excel(name = "销售人员", width = 15)
// @Excel(name = "销售人员", width = 15)
@ApiModelProperty(value = "销售人员")
private java.lang.String salesperson;
/**作业备注*/
@ -119,4 +125,6 @@ public class DeliveryDemand implements Serializable {
@Excel(name = "用车需求编号", width = 15)
@ApiModelProperty(value = "用车需求编号")
private String vdNo;
@TableField(exist = false)
private List<DeliveryDemandDetail> deliveryDemandDetailList;
}

View File

@ -3,10 +3,10 @@ package org.jeecg.modules.tms.outbound.deliverydemand.mapper;
import java.util.Date;
import java.util.List;
import com.baomidou.dynamic.datasource.annotation.DS;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.tms.outbound.deliverydemand.entity.DeliveryDemand;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.jeecg.modules.tms.outbound.deliverydemanddetail.entity.DeliveryDemandDetail;
/**
* @Description: 发货需求
@ -29,4 +29,6 @@ public interface DeliveryDemandMapper extends BaseMapper<DeliveryDemand> {
void updateByVdNo(String vdNo, String currentStatus);
List<String> getShip();
List<DeliveryDemandDetail> getShipDetail(String invoice);
}

View File

@ -20,5 +20,16 @@
<select id="getShip" resultType="java.lang.String">
select DISTINCT SHIPREQUESTNAME from MATERIALSHIPREQUEST
where SHIPREQUESTSTATE = 'Created'
and SITENAME = 'SDK'
</select>
<select id="getShipDetail" resultType="org.jeecg.modules.tms.outbound.deliverydemanddetail.entity.DeliveryDemandDetail"
parameterType="java.lang.String">
SELECT m2.SHIPREQUESTNAME invoice,m2.ERPLOCATION pickUpHubCode,bs.DESCRIPTION pickUpHub, m2.MATERIALSPECNAME pn,
MC.DESC_CN productName,MC.DESCRIPTION specName,m2.UNIT,m2.ASSIGNEDQUANTITY shipNumber
FROM MATERIALSHIPREQUESTDETAIL m2
LEFT JOIN MATERIALSPEC MC ON MC.MATERIALSPECNAME = m2.MATERIALSPECNAME
LEFT JOIN BS_ERPLOCATION bs ON bs.ERPLOCATIONNAME = m2.ERPLOCATION
WHERE m2.SHIPREQUESTNAME = #{invoice} AND m2.SITENAME = 'SDK'
</select>
</mapper>

View File

@ -3,6 +3,7 @@ package org.jeecg.modules.tms.outbound.deliverydemand.service;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.tms.outbound.deliverydemand.entity.DeliveryDemand;
import com.baomidou.mybatisplus.extension.service.IService;
import org.jeecg.modules.tms.outbound.deliverydemanddetail.entity.DeliveryDemandDetail;
import java.util.List;
@ -23,10 +24,10 @@ public interface IDeliveryDemandService extends IService<DeliveryDemand> {
/**
* 根据料号规格发货数量计算托盘数
* @param deliveryDemand
* @param deliveryDemands
* @return
*/
Result<?> getPalletsNum(DeliveryDemand deliveryDemand);
Result<?> getPalletsNum(List<DeliveryDemand> deliveryDemands);
/**
* 更新发货需求
@ -36,4 +37,6 @@ public interface IDeliveryDemandService extends IService<DeliveryDemand> {
void updateByVdNo(String vdNo, String currentStatus);
List<String> getShip();
List<DeliveryDemandDetail> getShipDetail(String invoice);
}

View File

@ -8,10 +8,12 @@ import lombok.RequiredArgsConstructor;
import org.jeecg.common.api.vo.Result;
import org.jeecg.modules.tms.basicdata.constant.GeneralSequenceConstant;
import org.jeecg.modules.tms.basicdata.generalsequence.service.IGeneralSequenceService;
import org.jeecg.modules.tms.basicdata.vehicleproduct.entity.TmsVehicleProduct;
import org.jeecg.modules.tms.basicdata.vehicleproduct.mapper.TmsVehicleProductMapper;
import org.jeecg.modules.tms.outbound.deliverydemand.entity.DeliveryDemand;
import org.jeecg.modules.tms.outbound.deliverydemand.mapper.DeliveryDemandMapper;
import org.jeecg.modules.tms.outbound.deliverydemand.service.IDeliveryDemandService;
import org.jeecg.modules.tms.outbound.deliverydemanddetail.entity.DeliveryDemandDetail;
import org.jeecg.modules.tms.outbound.vehicledemand.entity.VehicleDemand;
import org.jeecg.modules.tms.outbound.vehicledemand.service.IVehicleDemandService;
import org.springframework.stereotype.Service;
@ -107,17 +109,22 @@ public class DeliveryDemandServiceImpl extends ServiceImpl<DeliveryDemandMapper,
}
@Override
public Result<?> getPalletsNum(DeliveryDemand deliveryDemand) {
Integer qty = vehicleProductMapper.getQty(deliveryDemand.getPn(), deliveryDemand.getSpec());
public Result<?> getPalletsNum(List<DeliveryDemand> deliveryDemands) {
BigDecimal results = BigDecimal.ZERO;
for (DeliveryDemand deliveryDemand: deliveryDemands) {
Integer qty = vehicleProductMapper.getQty(deliveryDemand.getPn());
if (qty == null) {
return Result.error("数据为空");
// return Result.error("数据为空");
continue;
}
BigDecimal dividend = new BigDecimal(deliveryDemand.getShipNumber());
BigDecimal divisor = new BigDecimal(qty);
// 向上取整
BigDecimal result = dividend.divide(divisor, 0, RoundingMode.CEILING);
return Result.OK(result);
results = results.add(result);
}
return Result.OK(results);
}
@Override
@ -133,4 +140,10 @@ public class DeliveryDemandServiceImpl extends ServiceImpl<DeliveryDemandMapper,
public List<String> getShip() {
return deliveryDemandMapper.getShip();
}
@DS("wms")
@Override
public List<DeliveryDemandDetail> getShipDetail(String invoice) {
return deliveryDemandMapper.getShipDetail(invoice);
}
}

View File

@ -0,0 +1,186 @@
package org.jeecg.modules.tms.outbound.deliverydemanddetail.controller;
import java.util.Arrays;
import java.util.List;
import java.util.Map;
import java.util.stream.Collectors;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.net.URLDecoder;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import org.jeecg.common.api.vo.Result;
import org.jeecg.common.system.query.QueryGenerator;
import org.jeecg.common.util.oConvertUtils;
import org.jeecg.modules.tms.outbound.deliverydemanddetail.entity.DeliveryDemandDetail;
import org.jeecg.modules.tms.outbound.deliverydemanddetail.service.IDeliveryDemandDetailService;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.jeecgframework.poi.excel.ExcelImportUtil;
import org.jeecgframework.poi.excel.def.NormalExcelConstants;
import org.jeecgframework.poi.excel.entity.ExportParams;
import org.jeecgframework.poi.excel.entity.ImportParams;
import org.jeecgframework.poi.excel.view.JeecgEntityExcelView;
import org.jeecg.common.system.base.controller.JeecgController;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.multipart.MultipartFile;
import org.springframework.web.multipart.MultipartHttpServletRequest;
import org.springframework.web.servlet.ModelAndView;
import com.alibaba.fastjson.JSON;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.jeecg.common.aspect.annotation.AutoLog;
/**
* @Description: 发货需求明细
* @Author: jeecg-boot
* @Date: 2025-06-09
* @Version: V1.0
*/
@Api(tags="发货需求明细")
@RestController
@RequestMapping("/deliverydemanddetail/deliveryDemandDetail")
@Slf4j
public class DeliveryDemandDetailController extends JeecgController<DeliveryDemandDetail, IDeliveryDemandDetailService> {
@Autowired
private IDeliveryDemandDetailService deliveryDemandDetailService;
/**
* 分页列表查询
*
* @param deliveryDemandDetail
* @param pageNo
* @param pageSize
* @param req
* @return
*/
//@AutoLog(value = "发货需求明细-分页列表查询")
@ApiOperation(value="发货需求明细-分页列表查询", notes="发货需求明细-分页列表查询")
@GetMapping(value = "/list")
public Result<IPage<DeliveryDemandDetail>> queryPageList(DeliveryDemandDetail deliveryDemandDetail,
@RequestParam(name="pageNo", defaultValue="1") Integer pageNo,
@RequestParam(name="pageSize", defaultValue="10") Integer pageSize,
HttpServletRequest req) {
QueryWrapper<DeliveryDemandDetail> queryWrapper = QueryGenerator.initQueryWrapper(deliveryDemandDetail, req.getParameterMap());
Page<DeliveryDemandDetail> page = new Page<DeliveryDemandDetail>(pageNo, pageSize);
IPage<DeliveryDemandDetail> pageList = deliveryDemandDetailService.page(page, queryWrapper);
return Result.OK(pageList);
}
/**
* 添加
*
* @param deliveryDemandDetail
* @return
*/
@AutoLog(value = "发货需求明细-添加")
@ApiOperation(value="发货需求明细-添加", notes="发货需求明细-添加")
//@RequiresPermissions("org.jeecg.modules.tms:tms_delivery_demand_detail:add")
@PostMapping(value = "/add")
public Result<String> add(@RequestBody DeliveryDemandDetail deliveryDemandDetail) {
deliveryDemandDetailService.save(deliveryDemandDetail);
return Result.OK("添加成功!");
}
/**
* 编辑
*
* @param deliveryDemandDetail
* @return
*/
@AutoLog(value = "发货需求明细-编辑")
@ApiOperation(value="发货需求明细-编辑", notes="发货需求明细-编辑")
//@RequiresPermissions("org.jeecg.modules.tms:tms_delivery_demand_detail:edit")
@RequestMapping(value = "/edit", method = {RequestMethod.PUT,RequestMethod.POST})
public Result<String> edit(@RequestBody DeliveryDemandDetail deliveryDemandDetail) {
deliveryDemandDetailService.updateById(deliveryDemandDetail);
return Result.OK("编辑成功!");
}
/**
* 通过id删除
*
* @param id
* @return
*/
@AutoLog(value = "发货需求明细-通过id删除")
@ApiOperation(value="发货需求明细-通过id删除", notes="发货需求明细-通过id删除")
//@RequiresPermissions("org.jeecg.modules.tms:tms_delivery_demand_detail:delete")
@DeleteMapping(value = "/delete")
public Result<String> delete(@RequestParam(name="id",required=true) String id) {
deliveryDemandDetailService.removeById(id);
return Result.OK("删除成功!");
}
/**
* 批量删除
*
* @param ids
* @return
*/
@AutoLog(value = "发货需求明细-批量删除")
@ApiOperation(value="发货需求明细-批量删除", notes="发货需求明细-批量删除")
//@RequiresPermissions("org.jeecg.modules.tms:tms_delivery_demand_detail:deleteBatch")
@DeleteMapping(value = "/deleteBatch")
public Result<String> deleteBatch(@RequestParam(name="ids",required=true) String ids) {
this.deliveryDemandDetailService.removeByIds(Arrays.asList(ids.split(",")));
return Result.OK("批量删除成功!");
}
/**
* 通过id查询
*
* @param id
* @return
*/
//@AutoLog(value = "发货需求明细-通过id查询")
@ApiOperation(value="发货需求明细-通过id查询", notes="发货需求明细-通过id查询")
@GetMapping(value = "/queryById")
public Result<DeliveryDemandDetail> queryById(@RequestParam(name="id",required=true) String id) {
DeliveryDemandDetail deliveryDemandDetail = deliveryDemandDetailService.getById(id);
if(deliveryDemandDetail==null) {
return Result.error("未找到对应数据");
}
return Result.OK(deliveryDemandDetail);
}
/**
* 导出excel
*
* @param request
* @param deliveryDemandDetail
*/
//@RequiresPermissions("org.jeecg.modules.tms:tms_delivery_demand_detail:exportXls")
@RequestMapping(value = "/exportXls")
public ModelAndView exportXls(HttpServletRequest request, DeliveryDemandDetail deliveryDemandDetail) {
return super.exportXls(request, deliveryDemandDetail, DeliveryDemandDetail.class, "发货需求明细");
}
/**
* 通过excel导入数据
*
* @param request
* @param response
* @return
*/
//@RequiresPermissions("tms_delivery_demand_detail:importExcel")
@RequestMapping(value = "/importExcel", method = RequestMethod.POST)
public Result<?> importExcel(HttpServletRequest request, HttpServletResponse response) {
return super.importExcel(request, response, DeliveryDemandDetail.class);
}
@GetMapping(value = "/queryByDeliveryDemandId")
public Result<?> queryByDeliveryDemandId(@RequestParam(name="deliveryDemandId",required=true) String deliveryDemandId) {
LambdaQueryWrapper<DeliveryDemandDetail> lambdaQueryWrapper = new LambdaQueryWrapper<>();
lambdaQueryWrapper.eq(DeliveryDemandDetail::getDeliveryDemandId, deliveryDemandId);
List<DeliveryDemandDetail> list = deliveryDemandDetailService.list(lambdaQueryWrapper);
return Result.OK(list);
}
}

View File

@ -0,0 +1,94 @@
package org.jeecg.modules.tms.outbound.deliverydemanddetail.entity;
import java.io.Serializable;
import java.io.UnsupportedEncodingException;
import java.util.Date;
import java.math.BigDecimal;
import com.baomidou.mybatisplus.annotation.*;
import lombok.Data;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.springframework.format.annotation.DateTimeFormat;
import org.jeecgframework.poi.excel.annotation.Excel;
import org.jeecg.common.aspect.annotation.Dict;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
/**
* @Description: 发货需求明细
* @Author: jeecg-boot
* @Date: 2025-06-09
* @Version: V1.0
*/
@Data
@TableName("tms_delivery_demand_detail")
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="tms_delivery_demand_detail对象", description="发货需求明细")
public class DeliveryDemandDetail implements Serializable {
private static final long serialVersionUID = 1L;
/**主键*/
@TableId(type = IdType.ASSIGN_ID)
@ApiModelProperty(value = "主键")
private String id;
/**创建人*/
@ApiModelProperty(value = "创建人")
private String createBy;
/**创建日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "创建日期")
private Date createTime;
/**更新人*/
@ApiModelProperty(value = "更新人")
private String updateBy;
/**更新日期*/
@JsonFormat(timezone = "GMT+8",pattern = "yyyy-MM-dd HH:mm:ss")
@DateTimeFormat(pattern="yyyy-MM-dd HH:mm:ss")
@ApiModelProperty(value = "更新日期")
private Date updateTime;
/**所属部门*/
@ApiModelProperty(value = "所属部门")
private String sysOrgCode;
/**发货单*/
@Excel(name = "发货单", width = 15)
@ApiModelProperty(value = "发货单")
private String invoice;
/**取货仓库*/
@Excel(name = "取货仓库", width = 15)
@ApiModelProperty(value = "取货仓库")
private String pickUpHub;
/**取货仓库编码*/
@Excel(name = "取货仓库编码", width = 15)
@ApiModelProperty(value = "取货仓库编码")
private String pickUpHubCode;
/**料号*/
@Excel(name = "料号", width = 15)
@ApiModelProperty(value = "料号")
private String pn;
/**品名*/
@Excel(name = "品名", width = 15)
@ApiModelProperty(value = "品名")
private String productName;
/**规格*/
@Excel(name = "规格", width = 15)
@ApiModelProperty(value = "规格")
private String specName;
/**发货数量*/
@Excel(name = "发货数量", width = 15)
@ApiModelProperty(value = "发货数量")
private BigDecimal shipNumber;
/**单位*/
@Excel(name = "单位", width = 15)
@ApiModelProperty(value = "单位")
private String unit;
/**发货需求id*/
@Excel(name = "发货需求id", width = 15)
@ApiModelProperty(value = "发货需求id")
private String deliveryDemandId;
@TableField(exist = false)
private Boolean selected = false;
}

View File

@ -0,0 +1,17 @@
package org.jeecg.modules.tms.outbound.deliverydemanddetail.mapper;
import java.util.List;
import org.apache.ibatis.annotations.Param;
import org.jeecg.modules.tms.outbound.deliverydemanddetail.entity.DeliveryDemandDetail;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* @Description: 发货需求明细
* @Author: jeecg-boot
* @Date: 2025-06-09
* @Version: V1.0
*/
public interface DeliveryDemandDetailMapper extends BaseMapper<DeliveryDemandDetail> {
}

View File

@ -0,0 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="org.jeecg.modules.tms.outbound.deliverydemanddetail.mapper.DeliveryDemandDetailMapper">
</mapper>

View File

@ -0,0 +1,14 @@
package org.jeecg.modules.tms.outbound.deliverydemanddetail.service;
import org.jeecg.modules.tms.outbound.deliverydemanddetail.entity.DeliveryDemandDetail;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @Description: 发货需求明细
* @Author: jeecg-boot
* @Date: 2025-06-09
* @Version: V1.0
*/
public interface IDeliveryDemandDetailService extends IService<DeliveryDemandDetail> {
}

View File

@ -0,0 +1,19 @@
package org.jeecg.modules.tms.outbound.deliverydemanddetail.service.impl;
import org.jeecg.modules.tms.outbound.deliverydemanddetail.entity.DeliveryDemandDetail;
import org.jeecg.modules.tms.outbound.deliverydemanddetail.mapper.DeliveryDemandDetailMapper;
import org.jeecg.modules.tms.outbound.deliverydemanddetail.service.IDeliveryDemandDetailService;
import org.springframework.stereotype.Service;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* @Description: 发货需求明细
* @Author: jeecg-boot
* @Date: 2025-06-09
* @Version: V1.0
*/
@Service
public class DeliveryDemandDetailServiceImpl extends ServiceImpl<DeliveryDemandDetailMapper, DeliveryDemandDetail> implements IDeliveryDemandDetailService {
}