diff --git a/src/main/java/com/huaheng/pc/config/materialType/domain/MaterialType.java b/src/main/java/com/huaheng/pc/config/materialType/domain/MaterialType.java new file mode 100644 index 0000000..30ac59b --- /dev/null +++ b/src/main/java/com/huaheng/pc/config/materialType/domain/MaterialType.java @@ -0,0 +1,263 @@ +package com.huaheng.pc.config.materialType.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + +@ApiModel(value="com.huaheng.pc.config.materialType.domain.MaterialType") +@Data +@TableName(value = "material_type") +public class MaterialType implements Serializable { + /** + * ID + */ + @TableId(value = "id", type = IdType.AUTO) + @ApiModelProperty(value="ID") + private Integer id; + + /** + * 编码 + */ + @TableField(value = "code") + @ApiModelProperty(value="编码") + private String code; + + /** + * 名称 + */ + @TableField(value = "name") + @ApiModelProperty(value="名称") + private String name; + + /** + * 货主编码 + */ + @TableField(value = "companyCode") + @ApiModelProperty(value="货主编码") + private String companyCode; + + /** + * 仓库编码 + */ + @TableField(value = "warehouseCode") + @ApiModelProperty(value="仓库编码") + private String warehouseCode; + + /** + * ABC分类 + */ + @TableField(value = "abcClass") + @ApiModelProperty(value="ABC分类") + private String abcClass; + + /** + * 保质期(天) + */ + @TableField(value = "daysToExpire") + @ApiModelProperty(value="保质期(天)") + private Integer daysToExpire; + + /** + * 入库流程 + */ + @TableField(value = "receivingFlow") + @ApiModelProperty(value="入库流程") + private String receivingFlow; + + /** + * 出库流程 + */ + @TableField(value = "shippingFlow") + @ApiModelProperty(value="出库流程") + private String shippingFlow; + + /** + * 定位规则 + */ + @TableField(value = "locatingRule") + @ApiModelProperty(value="定位规则") + private String locatingRule; + + /** + * 分配规则 + */ + @TableField(value = "allocationRule") + @ApiModelProperty(value="分配规则") + private String allocationRule; + + /** + * 补货规则 + */ + @TableField(value = "replenishmentRule") + @ApiModelProperty(value="补货规则") + private String replenishmentRule; + + /** + * 空货位规则 + */ + @TableField(value = "emptyLocRule") + @ApiModelProperty(value="空货位规则") + private String emptyLocRule; + + /** + * 拣货规则 + */ + @TableField(value = "pickingRule") + @ApiModelProperty(value="拣货规则") + private String pickingRule; + + /** + * 属性模版 + */ + @TableField(value = "attributeTemplateCode") + @ApiModelProperty(value="属性模版") + private String attributeTemplateCode; + + /** + * 记录序列号 + */ + @TableField(value = "trackSerialNum") + @ApiModelProperty(value="记录序列号") + private Integer trackSerialNum; + + /** + * 自动生成序列号 + */ + @TableField(value = "autoGenSerialNum") + @ApiModelProperty(value="自动生成序列号") + private Integer autoGenSerialNum; + + /** + * 自动生成序列号表达式 + */ + @TableField(value = "autoGenSerialNumFormat") + @ApiModelProperty(value="自动生成序列号表达式") + private String autoGenSerialNumFormat; + + /** + * 序列号模版 + */ + @TableField(value = "snTemplateCode") + @ApiModelProperty(value="序列号模版") + private String snTemplateCode; + + /** + * 临期预警天数 + */ + @TableField(value = "expiringDays") + @ApiModelProperty(value="临期预警天数") + private Integer expiringDays; + + /** + * 收货预警天数 + */ + @TableField(value = "minShelfLifeDays") + @ApiModelProperty(value="收货预警天数") + private Integer minShelfLifeDays; + + /** + * 状态 + */ + @TableField(value = "enable") + @ApiModelProperty(value="状态") + private Integer enable; + + /** + * 创建时间 + */ + @TableField(value = "created") + @ApiModelProperty(value="创建时间") + private Date created; + + /** + * 创建用户 + */ + @TableField(value = "createdBy") + @ApiModelProperty(value="创建用户") + private String createdBy; + + /** + * 创建时间 + */ + @TableField(value = "lastUpdated") + @ApiModelProperty(value="创建时间") + private Date lastUpdated; + + /** + * 更新用户 + */ + @TableField(value = "lastUpdatedBy") + @ApiModelProperty(value="更新用户") + private String lastUpdatedBy; + + /** + * 数据版本 + */ + @TableField(value = "version") + @ApiModelProperty(value="数据版本") + private Integer version; + + /** + * 是否AGV区域发货 + */ + @TableField(value = "userDef1") + @ApiModelProperty(value="是否AGV区域发货") + private String userDef1; + + /** + * 自定义字段2 + */ + @TableField(value = "userDef2") + @ApiModelProperty(value="自定义字段2") + private String userDef2; + + /** + * 商品同步标识 + */ + @TableField(value = "userDef3") + @ApiModelProperty(value="商品同步标识") + private String userDef3; + + /** + * 自定义字段4 + */ + @TableField(value = "userDef4") + @ApiModelProperty(value="自定义字段4") + private String userDef4; + + /** + * 自定义字段5 + */ + @TableField(value = "userDef5") + @ApiModelProperty(value="自定义字段5") + private String userDef5; + + /** + * 自定义字段6 + */ + @TableField(value = "userDef6") + @ApiModelProperty(value="自定义字段6") + private String userDef6; + + /** + * 自定义字段7 + */ + @TableField(value = "userDef7") + @ApiModelProperty(value="自定义字段7") + private String userDef7; + + /** + * 自定义字段8 + */ + @TableField(value = "userDef8") + @ApiModelProperty(value="自定义字段8") + private String userDef8; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/src/main/java/com/huaheng/pc/config/materialType/mapper/MaterialTypeMapper.java b/src/main/java/com/huaheng/pc/config/materialType/mapper/MaterialTypeMapper.java new file mode 100644 index 0000000..0697b88 --- /dev/null +++ b/src/main/java/com/huaheng/pc/config/materialType/mapper/MaterialTypeMapper.java @@ -0,0 +1,7 @@ +package com.huaheng.pc.config.materialType.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huaheng.pc.config.materialType.domain.MaterialType; + +public interface MaterialTypeMapper extends BaseMapper<MaterialType> { +} \ No newline at end of file diff --git a/src/main/java/com/huaheng/pc/config/materialType/service/MaterialTypeService.java b/src/main/java/com/huaheng/pc/config/materialType/service/MaterialTypeService.java new file mode 100644 index 0000000..c08bd9e --- /dev/null +++ b/src/main/java/com/huaheng/pc/config/materialType/service/MaterialTypeService.java @@ -0,0 +1,12 @@ +package com.huaheng.pc.config.materialType.service; + +import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.util.List; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.huaheng.pc.config.materialType.domain.MaterialType; +import com.huaheng.pc.config.materialType.mapper.MaterialTypeMapper; +@Service +public class MaterialTypeService extends ServiceImpl<MaterialTypeMapper, MaterialType> { + +} diff --git a/src/main/java/com/huaheng/pc/config/statusFlow/controller/StatusFlowDetailController.java b/src/main/java/com/huaheng/pc/config/statusFlow/controller/StatusFlowDetailController.java index bcbbf20..3622ce4 100644 --- a/src/main/java/com/huaheng/pc/config/statusFlow/controller/StatusFlowDetailController.java +++ b/src/main/java/com/huaheng/pc/config/statusFlow/controller/StatusFlowDetailController.java @@ -15,7 +15,9 @@ import com.huaheng.framework.web.page.PageDomain; import com.huaheng.framework.web.page.TableDataInfo; import com.huaheng.framework.web.page.TableSupport; import com.huaheng.pc.config.statusFlow.domain.StatusFlowDetail; +import com.huaheng.pc.config.statusFlow.domain.StatusFlowHeader; import com.huaheng.pc.config.statusFlow.service.StatusFlowDetailService; +import com.huaheng.pc.config.statusFlow.service.StatusFlowHeaderService; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; @@ -35,6 +37,8 @@ public class StatusFlowDetailController extends BaseController { @Resource private StatusFlowDetailService statusFlowDetailService; + @Resource + private StatusFlowHeaderService statusFlowHeaderService; private String prefix = "config/statusFlowDetail"; @@ -89,7 +93,9 @@ public class StatusFlowDetailController extends BaseController { */ @GetMapping("/add/{headerId}") public String add(@PathVariable("headerId")Integer headerId, ModelMap mmap) { + StatusFlowHeader statusFlowHeader = statusFlowHeaderService.getById(headerId); mmap.put("headerId",headerId); + mmap.put("headerCode", statusFlowHeader.getCode()); return prefix + "/add"; } diff --git a/src/main/java/com/huaheng/pc/config/statusFlow/domain/StatusFlowDetail.java b/src/main/java/com/huaheng/pc/config/statusFlow/domain/StatusFlowDetail.java index 8219635..c6a424f 100644 --- a/src/main/java/com/huaheng/pc/config/statusFlow/domain/StatusFlowDetail.java +++ b/src/main/java/com/huaheng/pc/config/statusFlow/domain/StatusFlowDetail.java @@ -22,9 +22,13 @@ public class StatusFlowDetail implements Serializable { private Integer id; @TableField(value = "headerId") - @ApiModelProperty(value="null") + @ApiModelProperty(value="头表id") private Integer headerId; + @TableField(value = "headerCode") + @ApiModelProperty(value="头表编码") + private Integer headerCode; + /** * 状态流 */ diff --git a/src/main/java/com/huaheng/pc/config/statusFlow/service/StatusFlowDetailService.java b/src/main/java/com/huaheng/pc/config/statusFlow/service/StatusFlowDetailService.java index 2586d96..5108b8d 100644 --- a/src/main/java/com/huaheng/pc/config/statusFlow/service/StatusFlowDetailService.java +++ b/src/main/java/com/huaheng/pc/config/statusFlow/service/StatusFlowDetailService.java @@ -1,12 +1,22 @@ package com.huaheng.pc.config.statusFlow.service; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.List; +import java.util.WeakHashMap; + import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.huaheng.pc.config.statusFlow.domain.StatusFlowDetail; import com.huaheng.pc.config.statusFlow.mapper.StatusFlowDetailMapper; @Service public class StatusFlowDetailService extends ServiceImpl<StatusFlowDetailMapper, StatusFlowDetail> { + public List<StatusFlowDetail> queryStatusFlowDetail(String headerCode){ + LambdaQueryWrapper<StatusFlowDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); + lambdaQueryWrapper.orderByAsc(StatusFlowDetail::getSequence) + .eq(StatusFlowDetail::getHeaderCode, headerCode); + return this.list(lambdaQueryWrapper); + } } diff --git a/src/main/java/com/huaheng/pc/receipt/receiptDetail/controller/ReceiptDetailController.java b/src/main/java/com/huaheng/pc/receipt/receiptDetail/controller/ReceiptDetailController.java index 84b6ba7..5903f98 100644 --- a/src/main/java/com/huaheng/pc/receipt/receiptDetail/controller/ReceiptDetailController.java +++ b/src/main/java/com/huaheng/pc/receipt/receiptDetail/controller/ReceiptDetailController.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.huaheng.common.exception.service.ServiceException; import com.huaheng.common.support.Convert; import com.huaheng.common.utils.StringUtils; import com.huaheng.common.utils.security.ShiroUtils; @@ -23,6 +24,7 @@ import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import org.apache.ibatis.annotations.Param; import org.apache.shiro.authz.annotation.RequiresPermissions; +import org.aspectj.weaver.loadtime.Aj; import org.springframework.stereotype.Controller; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.*; @@ -152,4 +154,39 @@ public class ReceiptDetailController extends BaseController { // } // return toAjax(receiptDetailService.removeByIds(list)); //} + + /** + * 审核入库单 + */ + @ApiOperation(value="审核入库单", notes="审核入库单", httpMethod = "POST") + @RequiresPermissions("receipt:receiptDetail:approval") + @Log(title = "入库-入库单 ",operating = "审核入库单 ", action = BusinessType.UPDATE) + @PostMapping("/approval") + @ResponseBody + public AjaxResult approval(@ApiParam(name="id",value="入库明细表id") String ids, + @ApiParam(name="approval",value="审核结果值,10审核驳回,20作废,100审核成功") Integer approval) { + + if (StringUtils.isEmpty(ids)){ + return AjaxResult.error("id不能为空"); + } + if (approval != 10 || approval != 20 || approval != 100){ + return AjaxResult.error("传入参数错误"); + } + for (Integer id : Convert.toIntArray(ids)) { + ReceiptDetail receiptDetail = new ReceiptDetail(); + receiptDetail.setId(id); + receiptDetail.setProcessStamp(String.valueOf(approval)); + receiptDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); + if (receiptDetailService.updateById(receiptDetail)){ + ReceiptHeader receiptHeader = new ReceiptHeader(); + receiptHeader.setFirstStatus(approval); + receiptHeader.setId(receiptDetail.getReceiptId()); + receiptHeaderService.updateById(receiptHeader); + } else { + throw new ServiceException("审核失败"); + } + } + + return AjaxResult.success("审核成功"); + } } diff --git a/src/main/java/com/huaheng/pc/receipt/receiptDetail/service/ReceiptDetailServiceImpl.java b/src/main/java/com/huaheng/pc/receipt/receiptDetail/service/ReceiptDetailServiceImpl.java index ba48478..be419be 100644 --- a/src/main/java/com/huaheng/pc/receipt/receiptDetail/service/ReceiptDetailServiceImpl.java +++ b/src/main/java/com/huaheng/pc/receipt/receiptDetail/service/ReceiptDetailServiceImpl.java @@ -7,6 +7,14 @@ import com.huaheng.common.utils.security.ShiroUtils; import com.huaheng.framework.web.domain.AjaxResult; import com.huaheng.pc.config.material.domain.Material; import com.huaheng.pc.config.material.service.MaterialService; +import com.huaheng.pc.config.materialType.domain.MaterialType; +import com.huaheng.pc.config.materialType.service.MaterialTypeService; +import com.huaheng.pc.config.receiptPreference.domain.ReceiptPreference; +import com.huaheng.pc.config.receiptPreference.service.ReceiptPreferenceService; +import com.huaheng.pc.config.receiptType.domain.ReceiptType; +import com.huaheng.pc.config.receiptType.service.ReceiptTypeService; +import com.huaheng.pc.config.statusFlow.domain.StatusFlowDetail; +import com.huaheng.pc.config.statusFlow.service.StatusFlowDetailService; import com.huaheng.pc.receipt.receiptHeader.domain.ReceiptHeader; import com.huaheng.pc.receipt.receiptHeader.service.ReceiptHeaderService; import org.aspectj.weaver.loadtime.Aj; @@ -26,6 +34,14 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R private MaterialService materialService; @Resource private ReceiptHeaderService receiptHeaderService; + @Resource + private ReceiptTypeService receiptTypeService; + @Resource + private StatusFlowDetailService statusFlowDetailService; + @Resource + private MaterialTypeService materialTypeService; + @Resource + private ReceiptPreferenceService receiptPreferenceService; /** * 新增入库明细 @@ -35,15 +51,17 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R @Transactional public AjaxResult saveReceiptDetaial(ReceiptDetail receiptDetail){ /* 判断入库头表状态*/ - LambdaQueryWrapper<ReceiptHeader> lambda = Wrappers.lambdaQuery(); - lambda.eq(ReceiptHeader::getId, receiptDetail.getReceiptId()); - ReceiptHeader receiptHeader = receiptHeaderService.getOne(lambda); + LambdaQueryWrapper<ReceiptHeader> lambdaReceiptHeader = Wrappers.lambdaQuery(); + lambdaReceiptHeader.eq(ReceiptHeader::getId, receiptDetail.getReceiptId()); + ReceiptHeader receiptHeader = receiptHeaderService.getOne(lambdaReceiptHeader); + + //判断入库头表状态 if (receiptHeader == null ){ - return AjaxResult.error("找不到主单据"); + throw new ServiceException("找不到主单据"); } else if (receiptHeader.getFirstStatus() > 100){ - return AjaxResult.error("单据进入订单池后,不允许新增明细"); + throw new ServiceException("单据进入订单池后,不允许新增明细"); } else if (receiptHeader.getFirstStatus() == 20) { - return AjaxResult.error("单据销毁"); + throw new ServiceException("单据已作废"); } receiptDetail.setReceiptCode(receiptHeader.getCode()); @@ -52,7 +70,7 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R lambdaQueryWrapper.eq(Material::getCode, receiptDetail.getMaterialCode()); Material material = materialService.getOne(lambdaQueryWrapper); if (material == null) { - return AjaxResult.error("物料不存在"); + throw new ServiceException("物料不存在"); } receiptDetail.setCompanyCode(material.getCompanyCode()); receiptDetail.setMaterialName(material.getName()); @@ -63,6 +81,36 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R receiptDetail.setLastUpdatedBy(ShiroUtils.getLoginName()); receiptDetail.setWarehouseCode(ShiroUtils.getWarehouseCode()); + //查询头表中绑定的入库类型中的入库流程 + LambdaQueryWrapper<ReceiptType> lambdaReceiptType = Wrappers.lambdaQuery(); + lambdaReceiptType.eq(ReceiptType::getCode, receiptHeader.getReceiptType()); + ReceiptType receiptType = receiptTypeService.getOne(lambdaReceiptType); + if (receiptType.getReceiptFlow() != null){ + //物料是否有入库流程 + List<StatusFlowDetail> statusFlowDetails = statusFlowDetailService.queryStatusFlowDetail(receiptType.getReceiptFlow()); + receiptDetail.setProcessStamp(statusFlowDetails.get(0).getFlowCode()); + } else if (material.getReceivingFlow() != null){ + //物料是否有入库流程 + List<StatusFlowDetail> statusFlowDetails = statusFlowDetailService.queryStatusFlowDetail(material.getReceivingFlow()); + receiptDetail.setProcessStamp(statusFlowDetails.get(0).getFlowCode()); + } else { + //该物料类别是否有入库流程 + LambdaQueryWrapper<MaterialType> lambdaMaterialType = Wrappers.lambdaQuery(); + lambdaMaterialType.eq(MaterialType::getCode, material.getType()); + MaterialType materialType = materialTypeService.getOne(lambdaMaterialType); + if (materialType.getReceivingFlow() != null) { + List<StatusFlowDetail> statusFlowDetails = statusFlowDetailService.queryStatusFlowDetail(materialType.getReceivingFlow()); + receiptDetail.setProcessStamp(statusFlowDetails.get(0).getFlowCode()); + } else { + //以上都没有的情况下查询入库首选项中的入库流程 + LambdaQueryWrapper<ReceiptPreference> lambda = Wrappers.lambdaQuery(); + lambda.last("Limit 1"); + ReceiptPreference receiptPreference = receiptPreferenceService.getOne(lambda); + List<StatusFlowDetail> statusFlowDetails = statusFlowDetailService.queryStatusFlowDetail(receiptPreference.getReceivingFlow()); + receiptDetail.setProcessStamp(statusFlowDetails.get(0).getFlowCode()); + } + } + if (this.save(receiptDetail)) { receiptHeader.setTotalQty(receiptHeader.getTotalQty()+receiptDetail.getTotalQty()); receiptHeader.setTotalLines(receiptHeader.getTotalLines()+1); @@ -89,9 +137,9 @@ public class ReceiptDetailServiceImpl extends ServiceImpl<ReceiptDetailMapper, R ReceiptHeader receiptHeader = receiptHeaderService.getById(receiptDetail.getReceiptId()); //判断物料编码是否被修改 if (!originalReceiptDetail.getMaterialCode().equals(receiptDetail.getMaterialCode())){ - LambdaQueryWrapper<Material> lambda = Wrappers.lambdaQuery(); - lambda.eq(Material::getCode,receiptDetail.getMaterialCode()); - Material material = materialService.getOne(lambda); + LambdaQueryWrapper<Material> lambdaMaterial = Wrappers.lambdaQuery(); + lambdaMaterial.eq(Material::getCode,receiptDetail.getMaterialCode()); + Material material = materialService.getOne(lambdaMaterial); if (material == null) { throw new ServiceException("该物料编码不存在"); diff --git a/src/main/java/com/huaheng/pc/receipt/receiptHeader/service/ReceiptHeaderService.java b/src/main/java/com/huaheng/pc/receipt/receiptHeader/service/ReceiptHeaderService.java index b1ed7c4..f03e9ff 100644 --- a/src/main/java/com/huaheng/pc/receipt/receiptHeader/service/ReceiptHeaderService.java +++ b/src/main/java/com/huaheng/pc/receipt/receiptHeader/service/ReceiptHeaderService.java @@ -3,10 +3,13 @@ package com.huaheng.pc.receipt.receiptHeader.service; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.huaheng.common.exception.service.ServiceException; import com.huaheng.common.utils.security.ShiroUtils; import com.huaheng.framework.web.domain.AjaxResult; import com.huaheng.pc.config.receiptType.domain.ReceiptType; import com.huaheng.pc.config.receiptType.service.ReceiptTypeService; +import com.huaheng.pc.config.statusFlow.domain.StatusFlowDetail; +import com.huaheng.pc.config.statusFlow.service.StatusFlowDetailService; import com.huaheng.pc.receipt.receiptHeader.domain.ReceiptHeader; import com.huaheng.pc.receipt.receiptHeader.mapper.ReceiptHeaderMapper; import org.springframework.stereotype.Service; @@ -14,21 +17,27 @@ import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.text.SimpleDateFormat; import java.util.Date; +import java.util.List; @Service public class ReceiptHeaderService extends ServiceImpl<ReceiptHeaderMapper, ReceiptHeader> { @Resource private ReceiptTypeService receiptTypeService; + @Resource + private StatusFlowDetailService statusFlowDetailService; public AjaxResult saveReceiptHeader(ReceiptHeader receiptHeader){ LambdaQueryWrapper<ReceiptType> lambdaQueryWrapper = Wrappers.lambdaQuery(); lambdaQueryWrapper.eq(ReceiptType::getCode, receiptHeader.getReceiptType()); ReceiptType receiptType = receiptTypeService.getOne(lambdaQueryWrapper); - if(receiptType == null) { - return AjaxResult.error("没有对应的入库单类型"); - } else if (receiptType.getReceiptFlow() != null){ + //流程详情查询 + LambdaQueryWrapper<StatusFlowDetail> lambdaStatus = Wrappers.lambdaQuery(); + lambdaStatus.orderByAsc(StatusFlowDetail::getSequence); + + if(receiptType == null) { + throw new ServiceException("没有对应的入库单类型"); } String code = createCode(receiptHeader.getReceiptType()); diff --git a/src/main/java/com/huaheng/pc/shipment/shipmentDetailHistory/controller/ShipmentDetailHistoryController.java b/src/main/java/com/huaheng/pc/shipment/shipmentDetailHistory/controller/ShipmentDetailHistoryController.java index 21f3005..b7c54a2 100644 --- a/src/main/java/com/huaheng/pc/shipment/shipmentDetailHistory/controller/ShipmentDetailHistoryController.java +++ b/src/main/java/com/huaheng/pc/shipment/shipmentDetailHistory/controller/ShipmentDetailHistoryController.java @@ -15,6 +15,8 @@ import com.huaheng.framework.web.page.TableDataInfo; import com.huaheng.framework.web.page.TableSupport; import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailService; +import com.huaheng.pc.shipment.shipmentDetailHistory.domain.ShipmentDetailHistory; +import com.huaheng.pc.shipment.shipmentDetailHistory.service.ShipmentDetailHistoryService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -24,7 +26,7 @@ import org.springframework.web.bind.annotation.*; import java.util.List; /** - * 出库明细 信息操作处理 + * 历史出库明细 信息操作处理 * * @author huaheng * @date 2018-08-19 @@ -36,12 +38,12 @@ public class ShipmentDetailHistoryController extends BaseController private String prefix = "shipment/shipmentDetailHistory"; @Autowired - private ShipmentDetailService shipmentDetailService; + private ShipmentDetailHistoryService shipmentDetailHistoryService; @RequiresPermissions("shipment:bill:view") @GetMapping("/{shipmentId}/{shipmentCode}") - public String shipmentDetail(@PathVariable("shipmentId") String shipmentId, @PathVariable("shipmentCode") String shipmentCode,@PathVariable("inventoryStatus") String inventoryStatus, ModelMap mmap) + public String shipmentHistoryDetail(@PathVariable("shipmentId") String shipmentId, @PathVariable("shipmentCode") String shipmentCode,@PathVariable("inventoryStatus") String inventoryStatus, ModelMap mmap) { mmap.put("receiptId", shipmentId); mmap.put("shipmentCode", shipmentCode); @@ -53,31 +55,31 @@ public class ShipmentDetailHistoryController extends BaseController * 查询出库明细列表 */ @RequiresPermissions("shipment:bill:list") - @Log(title = "出库-出库单", operating= "查看出库明细", action = BusinessType.GRANT) + @Log(title = "出库-历史出库单", operating= "查看历史出库明细", action = BusinessType.GRANT) @PostMapping("/list") @ResponseBody - public TableDataInfo list(ShipmentDetail shipmentDetail) + public TableDataInfo list(ShipmentDetailHistory shipmentDetailHistory) { - LambdaQueryWrapper<ShipmentDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); + LambdaQueryWrapper<ShipmentDetailHistory> lambdaQueryWrapper = Wrappers.lambdaQuery(); PageDomain pageDomain = TableSupport.buildPageRequest(); Integer pageNum = pageDomain.getPageNum(); Integer pageSize = pageDomain.getPageSize(); lambdaQueryWrapper - .eq(ShipmentDetail::getWarehouseCode,ShiroUtils.getWarehouseCode()) - .in(ShipmentDetail::getCompanyCode,ShiroUtils.getCompanyCodeList()) - .eq(StringUtils.isNotEmpty(shipmentDetail.getShipmentCode()),ShipmentDetail::getShipmentCode,shipmentDetail.getShipmentCode()) - .orderByAsc(ShipmentDetail::getId); + .eq(ShipmentDetailHistory::getWarehouseCode,ShiroUtils.getWarehouseCode()) + .in(ShipmentDetailHistory::getCompanyCode,ShiroUtils.getCompanyCodeList()) + .eq(StringUtils.isNotEmpty(shipmentDetailHistory.getShipmentCode()),ShipmentDetailHistory::getShipmentCode,shipmentDetailHistory.getShipmentCode()) + .orderByAsc(ShipmentDetailHistory::getId); if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){ /** * 使用分页查询 */ - Page<ShipmentDetail> page = new Page<>(pageNum, pageSize); - IPage<ShipmentDetail> iPage = shipmentDetailService.page(page, lambdaQueryWrapper); + Page<ShipmentDetailHistory> page = new Page<>(pageNum, pageSize); + IPage<ShipmentDetailHistory> iPage = shipmentDetailHistoryService.page(page, lambdaQueryWrapper); return getMpDataTable(iPage.getRecords(),iPage.getTotal()); } else { - List<ShipmentDetail> list = shipmentDetailService.list(lambdaQueryWrapper); + List<ShipmentDetailHistory> list = shipmentDetailHistoryService.list(lambdaQueryWrapper); return getDataTable(list); } } @@ -87,12 +89,12 @@ public class ShipmentDetailHistoryController extends BaseController * 删除出库明细 */ @RequiresPermissions("shipment:bill:remove") - @Log(title = "出库-出库单", operating= "删除出库明细", action = BusinessType.DELETE) + @Log(title = "出库-历史出库单", operating= "删除历史出库明细", action = BusinessType.DELETE) @PostMapping( "/remove") @ResponseBody public AjaxResult remove(String ids) { - AjaxResult result = shipmentDetailService.deleteDetail(ids); + AjaxResult result = shipmentDetailHistoryService.deleteDetail(ids); return result; } diff --git a/src/main/java/com/huaheng/pc/shipment/shipmentDetailHistory/domain/ShipmentDetailHistory.java b/src/main/java/com/huaheng/pc/shipment/shipmentDetailHistory/domain/ShipmentDetailHistory.java new file mode 100644 index 0000000..9b4d99f --- /dev/null +++ b/src/main/java/com/huaheng/pc/shipment/shipmentDetailHistory/domain/ShipmentDetailHistory.java @@ -0,0 +1,1095 @@ +package com.huaheng.pc.shipment.shipmentDetailHistory.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@ApiModel(value="com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetailHistory") +@TableName(value = "shipment_detail_history") +public class ShipmentDetailHistory implements Serializable { + /** + * 出库单内部行号 + */ + @TableId(value = "id", type = IdType.AUTO) + @ApiModelProperty(value="出库单内部行号") + private Integer id; + + /** + * 出库单内部号 + */ + @TableField(value = "shipmentId") + @ApiModelProperty(value="出库单内部号") + private Integer shipmentId; + + /** + * 仓库 + */ + @TableField(value = "warehouseCode") + @ApiModelProperty(value="仓库") + private String warehouseCode; + + /** + * 货主 + */ + @TableField(value = "companyCode") + @ApiModelProperty(value="货主") + private String companyCode; + + /** + * 出库单号 + */ + @TableField(value = "shipmentCode") + @ApiModelProperty(value="出库单号") + private String shipmentCode; + + /** + * 上游订单号 + */ + @TableField(value = "referCode") + @ApiModelProperty(value="上游订单号") + private String referCode; + + /** + * 上游订单内部号 + */ + @TableField(value = "referId") + @ApiModelProperty(value="上游订单内部号") + private Integer referId; + + /** + * 上游订单行号 + */ + @TableField(value = "referLineNum") + @ApiModelProperty(value="上游订单行号") + private String referLineNum; + + /** + * 物料 + */ + @TableField(value = "materialCode") + @ApiModelProperty(value="物料") + private String materialCode; + + /** + * 物料描述 + */ + @TableField(value = "materialName") + @ApiModelProperty(value="物料描述") + private String materialName; + + /** + * 物料规格 + */ + @TableField(value = "materialSpec") + @ApiModelProperty(value="物料规格") + private String materialSpec; + + /** + * 物料单位 + */ + @TableField(value = "materialUnit") + @ApiModelProperty(value="物料单位") + private String materialUnit; + + /** + * 发货数量 + */ + @TableField(value = "shipQty") + @ApiModelProperty(value="发货数量") + private BigDecimal shipQty; + + /** + * 请求数量 + */ + @TableField(value = "requestQty") + @ApiModelProperty(value="请求数量") + private BigDecimal requestQty; + + /** + * 分配规则 + */ + @TableField(value = "allocationRule") + @ApiModelProperty(value="分配规则") + private String allocationRule; + + /** + * 补货规则 + */ + @TableField(value = "replenishmentRule") + @ApiModelProperty(value="补货规则") + private String replenishmentRule; + + /** + * 拣货货位 + */ + @TableField(value = "pickLocs") + @ApiModelProperty(value="拣货货位") + private String pickLocs; + + /** + * 属性1 + */ + @TableField(value = "attribute1") + @ApiModelProperty(value="属性1") + private String attribute1; + + /** + * 属性2 + */ + @TableField(value = "attribute2") + @ApiModelProperty(value="属性2") + private String attribute2; + + /** + * 属性3 + */ + @TableField(value = "attribute3") + @ApiModelProperty(value="属性3") + private String attribute3; + + /** + * 属性4 + */ + @TableField(value = "attribute4") + @ApiModelProperty(value="属性4") + private String attribute4; + + /** + * 批次 + */ + @TableField(value = "batch") + @ApiModelProperty(value="批次") + private String batch; + + /** + * 批号 + */ + @TableField(value = "lot") + @ApiModelProperty(value="批号") + private String lot; + + /** + * 项目号 + */ + @TableField(value = "projectNo") + @ApiModelProperty(value="项目号") + private String projectNo; + + /** + * 生产日期 + */ + @TableField(value = "manufactureDate") + @ApiModelProperty(value="生产日期") + private Date manufactureDate; + + /** + * 失效日期 + */ + @TableField(value = "expirationDate") + @ApiModelProperty(value="失效日期") + private Date expirationDate; + + /** + * 入库日期 + */ + @TableField(value = "agingDate") + @ApiModelProperty(value="入库日期") + private Date agingDate; + + /** + * 库存状态 + */ + @TableField(value = "inventorySts") + @ApiModelProperty(value="库存状态") + private String inventorySts; + + /** + * 月台货位 + */ + @TableField(value = "dockLoc") + @ApiModelProperty(value="月台货位") + private String dockLoc; + + /** + * 包装分类 + */ + @TableField(value = "packingClass") + @ApiModelProperty(value="包装分类") + private String packingClass; + + + /** + * 状态 + */ + @TableField(value = "status") + @ApiModelProperty(value="状态") + private Integer status; + + /** + * 波次号 + */ + @TableField(value = "waveId") + @ApiModelProperty(value="波次号") + private Integer waveId; + + /** + * 创建时间 + */ + @TableField(value = "created") + @ApiModelProperty(value="创建时间") + private Date created; + + /** + * 创建用户 + */ + @TableField(value = "createdBy") + @ApiModelProperty(value="创建用户") + private String createdBy; + + /** + * 创建时间 + */ + @TableField(value = "lastUpdated") + @ApiModelProperty(value="创建时间") + private Date lastUpdated; + + /** + * 更新用户 + */ + @TableField(value = "lastUpdatedBy") + @ApiModelProperty(value="更新用户") + private String lastUpdatedBy; + + /** + * 数据版本 + */ + @TableField(value = "version") + @ApiModelProperty(value="数据版本") + private Integer version; + + /** + * 自定义字段1 + */ + @TableField(value = "userDef1") + @ApiModelProperty(value="自定义字段1") + private String userDef1; + + /** + * 自定义字段2 + */ + @TableField(value = "userDef2") + @ApiModelProperty(value="自定义字段2") + private String userDef2; + + /** + * 自定义字段3 + */ + @TableField(value = "userDef3") + @ApiModelProperty(value="自定义字段3") + private String userDef3; + + /** + * 处理标记 + */ + @TableField(value = "processStamp") + @ApiModelProperty(value="处理标记") + private String processStamp; + + private static final long serialVersionUID = 1L; + + public static final String COL_SHIPMENTID = "shipmentId"; + + public static final String COL_WAREHOUSECODE = "warehouseCode"; + + public static final String COL_COMPANYCODE = "companyCode"; + + public static final String COL_SHIPMENTCODE = "shipmentCode"; + + public static final String COL_REFERCODE = "referCode"; + + public static final String COL_REFERID = "referId"; + + public static final String COL_REFERLINENUM = "referLineNum"; + + public static final String COL_MATERIALCODE = "materialCode"; + + public static final String COL_MATERIALNAME = "materialName"; + + public static final String COL_MATERIALSPEC = "materialSpec"; + + public static final String COL_MATERIALUNIT = "materialUnit"; + + public static final String COL_SHIPQTY = "shipQty"; + + public static final String COL_REQUESTQTY = "requestQty"; + + public static final String COL_ALLOCATIONRULE = "allocationRule"; + + public static final String COL_REPLENISHMENTRULE = "replenishmentRule"; + + public static final String COL_PICKLOCS = "pickLocs"; + + public static final String COL_ATTRIBUTE1 = "attribute1"; + + public static final String COL_ATTRIBUTE2 = "attribute2"; + + public static final String COL_ATTRIBUTE3 = "attribute3"; + + public static final String COL_ATTRIBUTE4 = "attribute4"; + + public static final String COL_BATCH = "batch"; + + public static final String COL_LOT = "lot"; + + public static final String COL_PROJECTNO = "projectNo"; + + public static final String COL_MANUFACTUREDATE = "manufactureDate"; + + public static final String COL_EXPIRATIONDATE = "expirationDate"; + + public static final String COL_AGINGDATE = "agingDate"; + + public static final String COL_INVENTORYSTS = "inventorySts"; + + public static final String COL_DOCKLOC = "dockLoc"; + + public static final String COL_PACKINGCLASS = "packingClass"; + + public static final String COL_ENABLE = "enable"; + + public static final String COL_WAVEID = "waveId"; + + public static final String COL_CREATED = "created"; + + public static final String COL_CREATEDBY = "createdBy"; + + public static final String COL_LASTUPDATED = "lastUpdated"; + + public static final String COL_LASTUPDATEDBY = "lastUpdatedBy"; + + public static final String COL_VERSION = "version"; + + public static final String COL_USERDEF1 = "userDef1"; + + public static final String COL_USERDEF2 = "userDef2"; + + public static final String COL_USERDEF3 = "userDef3"; + + public static final String COL_PROCESSSTAMP = "processStamp"; + + /** + * 获取出库单内部行号 + * + * @return id - 出库单内部行号 + */ + public Integer getId() { + return id; + } + + /** + * 设置出库单内部行号 + * + * @param id 出库单内部行号 + */ + public void setId(Integer id) { + this.id = id; + } + + /** + * 获取出库单内部号 + * + * @return shipmentId - 出库单内部号 + */ + public Integer getShipmentId() { + return shipmentId; + } + + /** + * 设置出库单内部号 + * + * @param shipmentId 出库单内部号 + */ + public void setShipmentId(Integer shipmentId) { + this.shipmentId = shipmentId; + } + + /** + * 获取仓库 + * + * @return warehouseCode - 仓库 + */ + public String getWarehouseCode() { + return warehouseCode; + } + + /** + * 设置仓库 + * + * @param warehouseCode 仓库 + */ + public void setWarehouseCode(String warehouseCode) { + this.warehouseCode = warehouseCode; + } + + /** + * 获取货主 + * + * @return companyCode - 货主 + */ + public String getCompanyCode() { + return companyCode; + } + + /** + * 设置货主 + * + * @param companyCode 货主 + */ + public void setCompanyCode(String companyCode) { + this.companyCode = companyCode; + } + + /** + * 获取出库单号 + * + * @return shipmentCode - 出库单号 + */ + public String getShipmentCode() { + return shipmentCode; + } + + /** + * 设置出库单号 + * + * @param shipmentCode 出库单号 + */ + public void setShipmentCode(String shipmentCode) { + this.shipmentCode = shipmentCode; + } + + /** + * 获取上游订单号 + * + * @return referCode - 上游订单号 + */ + public String getReferCode() { + return referCode; + } + + /** + * 设置上游订单号 + * + * @param referCode 上游订单号 + */ + public void setReferCode(String referCode) { + this.referCode = referCode; + } + + /** + * 获取上游订单内部号 + * + * @return referId - 上游订单内部号 + */ + public Integer getReferId() { + return referId; + } + + /** + * 设置上游订单内部号 + * + * @param referId 上游订单内部号 + */ + public void setReferId(Integer referId) { + this.referId = referId; + } + + /** + * 获取上游订单行号 + * + * @return referLineNum - 上游订单行号 + */ + public String getReferLineNum() { + return referLineNum; + } + + /** + * 设置上游订单行号 + * + * @param referLineNum 上游订单行号 + */ + public void setReferLineNum(String referLineNum) { + this.referLineNum = referLineNum; + } + + /** + * 获取物料 + * + * @return materialCode - 物料 + */ + public String getMaterialCode() { + return materialCode; + } + + /** + * 设置物料 + * + * @param materialCode 物料 + */ + public void setMaterialCode(String materialCode) { + this.materialCode = materialCode; + } + + /** + * 获取物料描述 + * + * @return materialName - 物料描述 + */ + public String getMaterialName() { + return materialName; + } + + /** + * 设置物料描述 + * + * @param materialName 物料描述 + */ + public void setMaterialName(String materialName) { + this.materialName = materialName; + } + + /** + * 获取物料规格 + * + * @return materialSpec - 物料规格 + */ + public String getMaterialSpec() { + return materialSpec; + } + + /** + * 设置物料规格 + * + * @param materialSpec 物料规格 + */ + public void setMaterialSpec(String materialSpec) { + this.materialSpec = materialSpec; + } + + /** + * 获取物料单位 + * + * @return materialUnit - 物料单位 + */ + public String getMaterialUnit() { + return materialUnit; + } + + /** + * 设置物料单位 + * + * @param materialUnit 物料单位 + */ + public void setMaterialUnit(String materialUnit) { + this.materialUnit = materialUnit; + } + + public BigDecimal getShipQty() { + return shipQty; + } + + public void setShipQty(BigDecimal shipQty) { + this.shipQty = shipQty; + } + + public BigDecimal getRequestQty() { + return requestQty; + } + + public void setRequestQty(BigDecimal requestQty) { + this.requestQty = requestQty; + } + + /** + * 获取分配规则 + * + * @return allocationRule - 分配规则 + */ + public String getAllocationRule() { + return allocationRule; + } + + /** + * 设置分配规则 + * + * @param allocationRule 分配规则 + */ + public void setAllocationRule(String allocationRule) { + this.allocationRule = allocationRule; + } + + /** + * 获取补货规则 + * + * @return replenishmentRule - 补货规则 + */ + public String getReplenishmentRule() { + return replenishmentRule; + } + + /** + * 设置补货规则 + * + * @param replenishmentRule 补货规则 + */ + public void setReplenishmentRule(String replenishmentRule) { + this.replenishmentRule = replenishmentRule; + } + + /** + * 获取拣货货位 + * + * @return pickLocs - 拣货货位 + */ + public String getPickLocs() { + return pickLocs; + } + + /** + * 设置拣货货位 + * + * @param pickLocs 拣货货位 + */ + public void setPickLocs(String pickLocs) { + this.pickLocs = pickLocs; + } + + /** + * 获取属性1 + * + * @return attribute1 - 属性1 + */ + public String getAttribute1() { + return attribute1; + } + + /** + * 设置属性1 + * + * @param attribute1 属性1 + */ + public void setAttribute1(String attribute1) { + this.attribute1 = attribute1; + } + + /** + * 获取属性2 + * + * @return attribute2 - 属性2 + */ + public String getAttribute2() { + return attribute2; + } + + /** + * 设置属性2 + * + * @param attribute2 属性2 + */ + public void setAttribute2(String attribute2) { + this.attribute2 = attribute2; + } + + /** + * 获取属性3 + * + * @return attribute3 - 属性3 + */ + public String getAttribute3() { + return attribute3; + } + + /** + * 设置属性3 + * + * @param attribute3 属性3 + */ + public void setAttribute3(String attribute3) { + this.attribute3 = attribute3; + } + + /** + * 获取属性4 + * + * @return attribute4 - 属性4 + */ + public String getAttribute4() { + return attribute4; + } + + /** + * 设置属性4 + * + * @param attribute4 属性4 + */ + public void setAttribute4(String attribute4) { + this.attribute4 = attribute4; + } + + /** + * 获取批次 + * + * @return batch - 批次 + */ + public String getBatch() { + return batch; + } + + /** + * 设置批次 + * + * @param batch 批次 + */ + public void setBatch(String batch) { + this.batch = batch; + } + + /** + * 获取批号 + * + * @return lot - 批号 + */ + public String getLot() { + return lot; + } + + /** + * 设置批号 + * + * @param lot 批号 + */ + public void setLot(String lot) { + this.lot = lot; + } + + /** + * 获取项目号 + * + * @return projectNo - 项目号 + */ + public String getProjectNo() { + return projectNo; + } + + /** + * 设置项目号 + * + * @param projectNo 项目号 + */ + public void setProjectNo(String projectNo) { + this.projectNo = projectNo; + } + + /** + * 获取生产日期 + * + * @return manufactureDate - 生产日期 + */ + public Date getManufactureDate() { + return manufactureDate; + } + + /** + * 设置生产日期 + * + * @param manufactureDate 生产日期 + */ + public void setManufactureDate(Date manufactureDate) { + this.manufactureDate = manufactureDate; + } + + /** + * 获取失效日期 + * + * @return expirationDate - 失效日期 + */ + public Date getExpirationDate() { + return expirationDate; + } + + /** + * 设置失效日期 + * + * @param expirationDate 失效日期 + */ + public void setExpirationDate(Date expirationDate) { + this.expirationDate = expirationDate; + } + + /** + * 获取入库日期 + * + * @return agingDate - 入库日期 + */ + public Date getAgingDate() { + return agingDate; + } + + /** + * 设置入库日期 + * + * @param agingDate 入库日期 + */ + public void setAgingDate(Date agingDate) { + this.agingDate = agingDate; + } + + /** + * 获取库存状态 + * + * @return inventorySts - 库存状态 + */ + public String getInventorySts() { + return inventorySts; + } + + /** + * 设置库存状态 + * + * @param inventorySts 库存状态 + */ + public void setInventorySts(String inventorySts) { + this.inventorySts = inventorySts; + } + + /** + * 获取月台货位 + * + * @return dockLoc - 月台货位 + */ + public String getDockLoc() { + return dockLoc; + } + + /** + * 设置月台货位 + * + * @param dockLoc 月台货位 + */ + public void setDockLoc(String dockLoc) { + this.dockLoc = dockLoc; + } + + /** + * 获取包装分类 + * + * @return packingClass - 包装分类 + */ + public String getPackingClass() { + return packingClass; + } + + /** + * 设置包装分类 + * + * @param packingClass 包装分类 + */ + public void setPackingClass(String packingClass) { + this.packingClass = packingClass; + } + + public Integer getStatus() { + return status; + } + + public void setStatus(Integer status) { + this.status = status; + } + + /** + * 获取波次号 + * + * @return waveId - 波次号 + */ + public Integer getWaveId() { + return waveId; + } + + /** + * 设置波次号 + * + * @param waveId 波次号 + */ + public void setWaveId(Integer waveId) { + this.waveId = waveId; + } + + /** + * 获取创建时间 + * + * @return created - 创建时间 + */ + public Date getCreated() { + return created; + } + + /** + * 设置创建时间 + * + * @param created 创建时间 + */ + public void setCreated(Date created) { + this.created = created; + } + + /** + * 获取创建用户 + * + * @return createdBy - 创建用户 + */ + public String getCreatedBy() { + return createdBy; + } + + /** + * 设置创建用户 + * + * @param createdBy 创建用户 + */ + public void setCreatedBy(String createdBy) { + this.createdBy = createdBy; + } + + /** + * 获取创建时间 + * + * @return lastUpdated - 创建时间 + */ + public Date getLastUpdated() { + return lastUpdated; + } + + /** + * 设置创建时间 + * + * @param lastUpdated 创建时间 + */ + public void setLastUpdated(Date lastUpdated) { + this.lastUpdated = lastUpdated; + } + + /** + * 获取更新用户 + * + * @return lastUpdatedBy - 更新用户 + */ + public String getLastUpdatedBy() { + return lastUpdatedBy; + } + + /** + * 设置更新用户 + * + * @param lastUpdatedBy 更新用户 + */ + public void setLastUpdatedBy(String lastUpdatedBy) { + this.lastUpdatedBy = lastUpdatedBy; + } + + /** + * 获取数据版本 + * + * @return version - 数据版本 + */ + public Integer getVersion() { + return version; + } + + /** + * 设置数据版本 + * + * @param version 数据版本 + */ + public void setVersion(Integer version) { + this.version = version; + } + + /** + * 获取自定义字段1 + * + * @return userDef1 - 自定义字段1 + */ + public String getUserDef1() { + return userDef1; + } + + /** + * 设置自定义字段1 + * + * @param userDef1 自定义字段1 + */ + public void setUserDef1(String userDef1) { + this.userDef1 = userDef1; + } + + /** + * 获取自定义字段2 + * + * @return userDef2 - 自定义字段2 + */ + public String getUserDef2() { + return userDef2; + } + + /** + * 设置自定义字段2 + * + * @param userDef2 自定义字段2 + */ + public void setUserDef2(String userDef2) { + this.userDef2 = userDef2; + } + + /** + * 获取自定义字段3 + * + * @return userDef3 - 自定义字段3 + */ + public String getUserDef3() { + return userDef3; + } + + /** + * 设置自定义字段3 + * + * @param userDef3 自定义字段3 + */ + public void setUserDef3(String userDef3) { + this.userDef3 = userDef3; + } + + + /** + * 获取处理标记 + * + * @return processStamp - 处理标记 + */ + public String getProcessStamp() { + return processStamp; + } + + /** + * 设置处理标记 + * + * @param processStamp 处理标记 + */ + public void setProcessStamp(String processStamp) { + this.processStamp = processStamp; + } +} \ No newline at end of file diff --git a/src/main/java/com/huaheng/pc/shipment/shipmentDetailHistory/mapper/ShipmentDetailHistoryMapper.java b/src/main/java/com/huaheng/pc/shipment/shipmentDetailHistory/mapper/ShipmentDetailHistoryMapper.java new file mode 100644 index 0000000..4b45a7a --- /dev/null +++ b/src/main/java/com/huaheng/pc/shipment/shipmentDetailHistory/mapper/ShipmentDetailHistoryMapper.java @@ -0,0 +1,19 @@ +package com.huaheng.pc.shipment.shipmentDetailHistory.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huaheng.pc.shipment.shipmentDetailHistory.domain.ShipmentDetailHistory; + +import java.util.List; +import java.util.Map; + + +public interface ShipmentDetailHistoryMapper extends BaseMapper<ShipmentDetailHistory> { + + + List<Map<String,Integer>> SelectFirstStatus(String ids); + + Integer batchDelete(String[] ids); + + Map<String,String> StatisticalByReceiptId(Integer headerId); + +} \ No newline at end of file diff --git a/src/main/java/com/huaheng/pc/shipment/shipmentDetailHistory/service/ShipmentDetailHistoryService.java b/src/main/java/com/huaheng/pc/shipment/shipmentDetailHistory/service/ShipmentDetailHistoryService.java new file mode 100644 index 0000000..a42b21c --- /dev/null +++ b/src/main/java/com/huaheng/pc/shipment/shipmentDetailHistory/service/ShipmentDetailHistoryService.java @@ -0,0 +1,12 @@ +package com.huaheng.pc.shipment.shipmentDetailHistory.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.huaheng.framework.web.domain.AjaxResult; +import com.huaheng.pc.shipment.shipmentDetailHistory.domain.ShipmentDetailHistory; + +public interface ShipmentDetailHistoryService extends IService<ShipmentDetailHistory>{ + + AjaxResult deleteDetail(String id); + + +} diff --git a/src/main/java/com/huaheng/pc/shipment/shipmentDetailHistory/service/ShipmentDetailHistoryServiceImpl.java b/src/main/java/com/huaheng/pc/shipment/shipmentDetailHistory/service/ShipmentDetailHistoryServiceImpl.java new file mode 100644 index 0000000..c7bda6c --- /dev/null +++ b/src/main/java/com/huaheng/pc/shipment/shipmentDetailHistory/service/ShipmentDetailHistoryServiceImpl.java @@ -0,0 +1,72 @@ +package com.huaheng.pc.shipment.shipmentDetailHistory.service; + + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.huaheng.common.utils.DataUtils; +import com.huaheng.common.utils.StringUtils; +import com.huaheng.framework.web.domain.AjaxResult; +import com.huaheng.pc.shipment.shipmentDetailHistory.domain.ShipmentDetailHistory; +import com.huaheng.pc.shipment.shipmentDetailHistory.mapper.ShipmentDetailHistoryMapper; +import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader; +import com.huaheng.pc.shipment.shipmentHeaderHistory.domain.ShipmentHeaderHistory; +import com.huaheng.pc.shipment.shipmentHeaderHistory.service.ShipmentHeaderHistoryService; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.List; +import java.util.Map; + +@Service +public class ShipmentDetailHistoryServiceImpl extends ServiceImpl<ShipmentDetailHistoryMapper, ShipmentDetailHistory> implements ShipmentDetailHistoryService { + + + @Resource + private ShipmentDetailHistoryMapper shipmentDetailHistoryMapper; + @Autowired + private ShipmentHeaderHistoryService shipmentHeaderHistoryService; + + /** + * 删除出库单据明细 + * + * @param id + * @return + */ + @Override + @Transactional + public AjaxResult deleteDetail(String id) { + if (StringUtils.isEmpty(id)) + return AjaxResult.error("id不能为空"); + String[] ids = id.split(","); + List<Map<String,Integer>> list = shipmentDetailHistoryMapper.SelectFirstStatus(id); + if (list.size() < 1) { + return AjaxResult.error("找不到主单据!"); + } + if (list.size() > 1) { + return AjaxResult.error("有多个主单据,不能一起删除!"); + } + if (list.get(0).get("firstStatus") > 100) { + return AjaxResult.error("单据状进入订单池,不允许删除明细"); + } + Integer result = shipmentDetailHistoryMapper.batchDelete(ids); + if (result > 0) { + Integer headerId=list.get(0).get("id"); + Map<String,String> map= shipmentDetailHistoryMapper.StatisticalByReceiptId(headerId); + if(DataUtils.getInteger(map.get("totalLines")) <= 0) { + shipmentHeaderHistoryService.removeById(headerId); + } + else { + //更新表头的总行数和总数量统计 + ShipmentHeaderHistory shipmentHeaderHistory = new ShipmentHeaderHistory(); + shipmentHeaderHistory.setId(headerId); + shipmentHeaderHistory.setTotalLines(DataUtils.getInteger(map.get("totalLines"))); + shipmentHeaderHistory.setTotalQty(DataUtils.getBigDecimal(map.get("totalQty"))); + shipmentHeaderHistoryService.saveOrUpdate(shipmentHeaderHistory); + } + return AjaxResult.success("删除单据明细成功"); + } + else + return AjaxResult.error("删除单据明细失败"); + } +} diff --git a/src/main/java/com/huaheng/pc/shipment/shipmentHeader/controller/ShipmentHeaderController.java b/src/main/java/com/huaheng/pc/shipment/shipmentHeader/controller/ShipmentHeaderController.java index 58964d5..6cdaaeb 100644 --- a/src/main/java/com/huaheng/pc/shipment/shipmentHeader/controller/ShipmentHeaderController.java +++ b/src/main/java/com/huaheng/pc/shipment/shipmentHeader/controller/ShipmentHeaderController.java @@ -4,6 +4,7 @@ import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.metadata.IPage; import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +import com.huaheng.common.exception.service.ServiceException; import com.huaheng.common.support.Convert; import com.huaheng.common.utils.StringUtils; import com.huaheng.common.utils.security.ShiroUtils; @@ -11,7 +12,6 @@ import com.huaheng.framework.aspectj.lang.annotation.Log; import com.huaheng.framework.aspectj.lang.constant.BusinessType; import com.huaheng.framework.web.controller.BaseController; import com.huaheng.framework.web.domain.AjaxResult; -import com.huaheng.framework.web.domain.RetCode; import com.huaheng.framework.web.page.PageDomain; import com.huaheng.framework.web.page.TableDataInfo; import com.huaheng.framework.web.page.TableSupport; @@ -22,9 +22,11 @@ import com.huaheng.pc.shipment.shipmentHeader.service.ShipmentHeaderService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; +import org.springframework.transaction.annotation.Transactional; import org.springframework.ui.ModelMap; import org.springframework.web.bind.annotation.*; +import java.lang.reflect.InvocationTargetException; import java.util.List; @@ -44,7 +46,6 @@ public class ShipmentHeaderController extends BaseController private ShipmentHeaderService shipmentHeaderService; @Autowired private ShipmentDetailService shipmentDetailService; - @RequiresPermissions("shipment:bill:view") @GetMapping() @@ -155,18 +156,25 @@ public class ShipmentHeaderController extends BaseController @Log(title = "出库-出库单", operating="删除出库主单", action = BusinessType.DELETE) @PostMapping( "/remove") @ResponseBody - public AjaxResult remove(String ids) { + @Transactional + public AjaxResult remove(String ids) throws InvocationTargetException, IllegalAccessException { if (StringUtils.isEmpty(ids)) return AjaxResult.error("id不能为空"); for (Integer id : Convert.toIntArray(ids)) { - ShipmentHeader shipmentHeader=new ShipmentHeader(); - shipmentHeader.setId(id); + ShipmentHeader shipmentHeader=shipmentHeaderService.getById(id); + + //出库单设定为历史出库单,并删除出库单 + shipmentHeaderService.addHistory(shipmentHeader); shipmentHeader.setDeleted(true); - boolean result=shipmentHeaderService.updateById(shipmentHeader); + boolean result=shipmentHeaderService.removeById(id); if(result==false){ - return AjaxResult.error("删除失败"); + throw new ServiceException("删除失败"); } + LambdaQueryWrapper<ShipmentDetail> shipmentDetailLambdaQueryWrapper=Wrappers.lambdaQuery(); + shipmentDetailLambdaQueryWrapper.eq(ShipmentDetail::getShipmentCode,shipmentHeader.getCode()) + .eq(ShipmentDetail::getWarehouseCode,shipmentHeader.getWarehouseCode()); + shipmentDetailService.remove(shipmentDetailLambdaQueryWrapper); } return AjaxResult.success("删除成功!"); } diff --git a/src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderService.java b/src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderService.java index 3f8ff3f..0120581 100644 --- a/src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderService.java +++ b/src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderService.java @@ -3,6 +3,9 @@ package com.huaheng.pc.shipment.shipmentHeader.service; import com.huaheng.framework.web.domain.AjaxResult; import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader; import com.baomidou.mybatisplus.extension.service.IService; + +import java.lang.reflect.InvocationTargetException; + public interface ShipmentHeaderService extends IService<ShipmentHeader>{ //新增出库主单 @@ -15,4 +18,6 @@ public interface ShipmentHeaderService extends IService<ShipmentHeader>{ //根据Id更新这个单据的首尾状态 AjaxResult updateShipmentStatus(int shipmentId); + AjaxResult addHistory(ShipmentHeader shipmentHeader) throws InvocationTargetException, IllegalAccessException; + } diff --git a/src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderServiceImpl.java b/src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderServiceImpl.java index a4bffa4..24425d6 100644 --- a/src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderServiceImpl.java +++ b/src/main/java/com/huaheng/pc/shipment/shipmentHeader/service/ShipmentHeaderServiceImpl.java @@ -1,14 +1,25 @@ package com.huaheng.pc.shipment.shipmentHeader.service; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.huaheng.common.exception.service.ServiceException; import com.huaheng.common.utils.security.ShiroUtils; import com.huaheng.framework.web.domain.AjaxResult; import com.huaheng.pc.shipment.shipmentContainerHeader.service.ShipmentContainerHeaderService; +import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailService; +import com.huaheng.pc.shipment.shipmentDetailHistory.domain.ShipmentDetailHistory; +import com.huaheng.pc.shipment.shipmentDetailHistory.service.ShipmentDetailHistoryService; +import com.huaheng.pc.shipment.shipmentHeaderHistory.domain.ShipmentHeaderHistory; +import com.huaheng.pc.shipment.shipmentHeaderHistory.service.ShipmentHeaderHistoryService; import com.huaheng.pc.system.dict.service.IDictDataService; +import org.apache.commons.beanutils.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.lang.reflect.InvocationTargetException; import java.text.SimpleDateFormat; +import java.util.ArrayList; import java.util.Date; import java.util.List; import java.util.Map; @@ -17,6 +28,8 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader; import com.huaheng.pc.shipment.shipmentHeader.mapper.ShipmentHeaderMapper; import com.huaheng.pc.shipment.shipmentHeader.service.ShipmentHeaderService; +import org.springframework.transaction.annotation.Transactional; + @Service public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, ShipmentHeader> implements ShipmentHeaderService{ @@ -28,6 +41,11 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, private ShipmentDetailService shipmentDetailService; @Autowired private ShipmentContainerHeaderService shipmentContainerHeaderService; + @Autowired + private ShipmentHeaderHistoryService shipmentHeaderHistoryService; + @Autowired + private ShipmentDetailHistoryService shipmentDetailHistoryService; + //新增出库主单 @@ -122,4 +140,33 @@ public class ShipmentHeaderServiceImpl extends ServiceImpl<ShipmentHeaderMapper, return AjaxResult.success(""); } + + //出库单字段变为历史出库单 + @Override + @Transactional + public AjaxResult addHistory(ShipmentHeader shipmentHeader) throws InvocationTargetException, IllegalAccessException { + //历史出库主单 + ShipmentHeaderHistory shipmentHeaderHistory=new ShipmentHeaderHistory(); + BeanUtils.copyProperties(shipmentHeaderHistory,shipmentHeader); + if(shipmentHeaderHistoryService.save(shipmentHeaderHistory)==false){ + throw new ServiceException("存入历史出库主单失败"); + } + LambdaQueryWrapper<ShipmentDetail> lambdaQueryWrapper=Wrappers.lambdaQuery(); + lambdaQueryWrapper.eq(ShipmentDetail::getWarehouseCode,shipmentHeader.getWarehouseCode()) + .eq(ShipmentDetail::getShipmentCode,shipmentHeader.getCode()); + List<ShipmentDetail> shipmentDetails=shipmentDetailService.list(lambdaQueryWrapper); + + //历史出库子单 + List<ShipmentDetailHistory> shipmentDetailHistories=new ArrayList<>(); + for(ShipmentDetail item:shipmentDetails){ + ShipmentDetailHistory shipmentDetailHistory=new ShipmentDetailHistory(); + BeanUtils.copyProperties(shipmentDetailHistory,item); + shipmentDetailHistories.add(shipmentDetailHistory); + } + Boolean flag=shipmentDetailHistoryService.saveBatch(shipmentDetailHistories); + if(flag==false){ + throw new ServiceException("存入历史出库子单失败"); + } + return null; + } } diff --git a/src/main/java/com/huaheng/pc/shipment/shipmentHeaderHistory/controller/ShipmentHeaderHistoryController.java b/src/main/java/com/huaheng/pc/shipment/shipmentHeaderHistory/controller/ShipmentHeaderHistoryController.java index 3ae9ba0..339ff29 100644 --- a/src/main/java/com/huaheng/pc/shipment/shipmentHeaderHistory/controller/ShipmentHeaderHistoryController.java +++ b/src/main/java/com/huaheng/pc/shipment/shipmentHeaderHistory/controller/ShipmentHeaderHistoryController.java @@ -14,10 +14,10 @@ import com.huaheng.framework.web.domain.AjaxResult; import com.huaheng.framework.web.page.PageDomain; import com.huaheng.framework.web.page.TableDataInfo; import com.huaheng.framework.web.page.TableSupport; -import com.huaheng.pc.shipment.shipmentDetail.domain.ShipmentDetail; -import com.huaheng.pc.shipment.shipmentDetail.service.ShipmentDetailService; -import com.huaheng.pc.shipment.shipmentHeader.domain.ShipmentHeader; -import com.huaheng.pc.shipment.shipmentHeader.service.ShipmentHeaderService; +import com.huaheng.pc.shipment.shipmentDetailHistory.domain.ShipmentDetailHistory; +import com.huaheng.pc.shipment.shipmentDetailHistory.service.ShipmentDetailHistoryService; +import com.huaheng.pc.shipment.shipmentHeaderHistory.domain.ShipmentHeaderHistory; +import com.huaheng.pc.shipment.shipmentHeaderHistory.service.ShipmentHeaderHistoryService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -40,14 +40,14 @@ public class ShipmentHeaderHistoryController extends BaseController private String prefix = "shipment/shipmentHeaderHistory"; @Autowired - private ShipmentHeaderService shipmentHeaderService; + private ShipmentHeaderHistoryService shipmentHeaderHistoryService; @Autowired - private ShipmentDetailService shipmentDetailService; + private ShipmentDetailHistoryService shipmentDetailHistoryService; @RequiresPermissions("shipment:bill:view") @GetMapping() - public String shipmentHeader() + public String shipmentHeaderHistory() { return prefix + "/shipmentHeaderHistory"; } @@ -56,38 +56,38 @@ public class ShipmentHeaderHistoryController extends BaseController * 查询出库单主列表 */ @RequiresPermissions("shipment:bill:list") - @Log(title = "出库-出库单", operating="查看出库主单", action = BusinessType.GRANT) + @Log(title = "出库-出库单历史", operating="查看历史出库主单", action = BusinessType.GRANT) @PostMapping("/list") @ResponseBody - public TableDataInfo list(ShipmentHeader shipmentHeader,String createdBegin, String createdEnd) + public TableDataInfo list(ShipmentHeaderHistory shipmentHeaderHistory, String createdBegin, String createdEnd) { - LambdaQueryWrapper<ShipmentHeader> lambdaQueryWrapper = Wrappers.lambdaQuery(); + LambdaQueryWrapper<ShipmentHeaderHistory> lambdaQueryWrapper = Wrappers.lambdaQuery(); PageDomain pageDomain = TableSupport.buildPageRequest(); Integer pageNum = pageDomain.getPageNum(); Integer pageSize = pageDomain.getPageSize(); - lambdaQueryWrapper.ge(StringUtils.isNotEmpty(createdBegin),ShipmentHeader::getCreated, createdBegin) - .le(StringUtils.isNotEmpty(createdEnd), ShipmentHeader::getCreated, createdEnd) - .eq(ShipmentHeader::getWarehouseCode,ShiroUtils.getWarehouseCode()) - .eq(ShipmentHeader::getDeleted,true) - .in(ShipmentHeader::getCompanyCode,ShiroUtils.getCompanyCodeList()) - .eq(StringUtils.isNotEmpty(shipmentHeader.getCode()),ShipmentHeader::getCode,shipmentHeader.getCode()) - .eq(StringUtils.isNotEmpty(shipmentHeader.getShipmentType()),ShipmentHeader::getShipmentType,shipmentHeader.getShipmentType()) - .eq(StringUtils.isNotEmpty(shipmentHeader.getReferCode()), ShipmentHeader::getReferCode, shipmentHeader.getReferCode()) - .eq(StringUtils.isNotEmpty(shipmentHeader.getReferCodeType()), ShipmentHeader::getReferCodeType, shipmentHeader.getReferCodeType()) - .eq(shipmentHeader.getFirstStatus()!=null, ShipmentHeader::getFirstStatus, shipmentHeader.getFirstStatus()) - .eq(shipmentHeader.getLastStatus()!=null, ShipmentHeader::getLastStatus, shipmentHeader.getLastStatus()) - .orderByDesc(ShipmentHeader::getId); + lambdaQueryWrapper.ge(StringUtils.isNotEmpty(createdBegin),ShipmentHeaderHistory::getCreated, createdBegin) + .le(StringUtils.isNotEmpty(createdEnd), ShipmentHeaderHistory::getCreated, createdEnd) + .eq(ShipmentHeaderHistory::getWarehouseCode,ShiroUtils.getWarehouseCode()) + .eq(ShipmentHeaderHistory::getDeleted,false) + .in(ShipmentHeaderHistory::getCompanyCode,ShiroUtils.getCompanyCodeList()) + .eq(StringUtils.isNotEmpty(shipmentHeaderHistory.getCode()),ShipmentHeaderHistory::getCode,shipmentHeaderHistory.getCode()) + .eq(StringUtils.isNotEmpty(shipmentHeaderHistory.getShipmentType()),ShipmentHeaderHistory::getShipmentType,shipmentHeaderHistory.getShipmentType()) + .eq(StringUtils.isNotEmpty(shipmentHeaderHistory.getReferCode()), ShipmentHeaderHistory::getReferCode, shipmentHeaderHistory.getReferCode()) + .eq(StringUtils.isNotEmpty(shipmentHeaderHistory.getReferCodeType()), ShipmentHeaderHistory::getReferCodeType, shipmentHeaderHistory.getReferCodeType()) + .eq(shipmentHeaderHistory.getFirstStatus()!=null, ShipmentHeaderHistory::getFirstStatus, shipmentHeaderHistory.getFirstStatus()) + .eq(shipmentHeaderHistory.getLastStatus()!=null, ShipmentHeaderHistory::getLastStatus, shipmentHeaderHistory.getLastStatus()) + .orderByDesc(ShipmentHeaderHistory::getId); if (StringUtils.isNotNull(pageNum) && StringUtils.isNotNull(pageSize)){ /** * 使用分页查询 */ - Page<ShipmentHeader> page = new Page<>(pageNum, pageSize); - IPage<ShipmentHeader> iPage = shipmentHeaderService.page(page, lambdaQueryWrapper); + Page<ShipmentHeaderHistory> page = new Page<>(pageNum, pageSize); + IPage<ShipmentHeaderHistory> iPage = shipmentHeaderHistoryService.page(page, lambdaQueryWrapper); return getMpDataTable(iPage.getRecords(),iPage.getTotal()); } else { - List<ShipmentHeader> list = shipmentHeaderService.list(lambdaQueryWrapper); + List<ShipmentHeaderHistory> list = shipmentHeaderHistoryService.list(lambdaQueryWrapper); return getDataTable(list); } } @@ -97,7 +97,7 @@ public class ShipmentHeaderHistoryController extends BaseController * 删除出库单主 */ @RequiresPermissions("shipment:bill:remove") - @Log(title = "出库-出库单", operating="删除出库主单", action = BusinessType.DELETE) + @Log(title = "出库-历史出库单", operating="删除历史出库主单", action = BusinessType.DELETE) @PostMapping( "/remove") @ResponseBody public AjaxResult remove(String ids) { @@ -105,12 +105,12 @@ public class ShipmentHeaderHistoryController extends BaseController return AjaxResult.error("id不能为空"); for (Integer id : Convert.toIntArray(ids)) { - boolean result=shipmentHeaderService.removeById(id); - LambdaQueryWrapper<ShipmentDetail> lambdaQueryWrapper=Wrappers.lambdaQuery(); - lambdaQueryWrapper.eq(ShipmentDetail::getShipmentId,id) - .eq(ShipmentDetail::getWarehouseCode,ShiroUtils.getWarehouseCode()); + boolean result=shipmentHeaderHistoryService.removeById(id); + LambdaQueryWrapper<ShipmentDetailHistory> lambdaQueryWrapper=Wrappers.lambdaQuery(); + lambdaQueryWrapper.eq(ShipmentDetailHistory::getShipmentId,id) + .eq(ShipmentDetailHistory::getWarehouseCode,ShiroUtils.getWarehouseCode()); Boolean flag=true; - flag=shipmentDetailService.remove(lambdaQueryWrapper); + flag=shipmentDetailHistoryService.remove(lambdaQueryWrapper); if(flag==false){ return AjaxResult.error("删除失败"); } @@ -126,17 +126,17 @@ public class ShipmentHeaderHistoryController extends BaseController * @return */ @RequiresPermissions("shipment:bill:report") - @Log(title = "出库-出库单", operating="打印出库单报表", action = BusinessType.OTHER) + @Log(title = "出库-历史出库单", operating="打印历史出库单报表", action = BusinessType.OTHER) @GetMapping("/report/{id}") public String report(@PathVariable("id") Integer id, ModelMap mmap) { - ShipmentHeader shipmentHeader = shipmentHeaderService.getById(id); - mmap.put("shipmentHeader", shipmentHeader); + ShipmentHeaderHistory shipmentHeaderHistory = shipmentHeaderHistoryService.getById(id); + mmap.put("shipmentHeader", shipmentHeaderHistory); - LambdaQueryWrapper<ShipmentDetail> lambdaQueryWrapper = Wrappers.lambdaQuery(); - lambdaQueryWrapper.eq(ShipmentDetail::getShipmentId,id) - .eq(ShipmentDetail::getWarehouseCode,ShiroUtils.getWarehouseCode()); - List<ShipmentDetail> details = shipmentDetailService.list(lambdaQueryWrapper); + LambdaQueryWrapper<ShipmentDetailHistory> lambdaQueryWrapper = Wrappers.lambdaQuery(); + lambdaQueryWrapper.eq(ShipmentDetailHistory::getShipmentId,id) + .eq(ShipmentDetailHistory::getWarehouseCode,ShiroUtils.getWarehouseCode()); + List<ShipmentDetailHistory> details = shipmentDetailHistoryService.list(lambdaQueryWrapper); mmap.put("details", details); return prefix + "/report"; @@ -144,8 +144,8 @@ public class ShipmentHeaderHistoryController extends BaseController @PostMapping("/getShipmentHeader") @ResponseBody - public AjaxResult<ShipmentHeader> getShipmentHeader(int id){ - return AjaxResult.success(shipmentHeaderService.getById(id)); + public AjaxResult<ShipmentHeaderHistory> getShipmentHeader(int id){ + return AjaxResult.success(shipmentHeaderHistoryService.getById(id)); } diff --git a/src/main/java/com/huaheng/pc/shipment/shipmentHeaderHistory/domain/ShipmentHeaderHistory.java b/src/main/java/com/huaheng/pc/shipment/shipmentHeaderHistory/domain/ShipmentHeaderHistory.java new file mode 100644 index 0000000..c175a29 --- /dev/null +++ b/src/main/java/com/huaheng/pc/shipment/shipmentHeaderHistory/domain/ShipmentHeaderHistory.java @@ -0,0 +1,473 @@ +package com.huaheng.pc.shipment.shipmentHeaderHistory.domain; + +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; + +import java.io.Serializable; +import java.math.BigDecimal; +import java.util.Date; + +@ApiModel(value = "com.huaheng.pc.shipment.shipmentHeaderHistory.domain.ShipmentHeaderHistory") +@Data +@TableName(value = "shipment_header_history") +public class ShipmentHeaderHistory implements Serializable { + /** + * 出库单内部号 + */ + @TableId(value = "id", type = IdType.AUTO) + @ApiModelProperty(value = "出库单内部号") + private Integer id; + + /** + * 仓库 + */ + @TableField(value = "warehouseCode") + @ApiModelProperty(value = "仓库") + private String warehouseCode; + + /** + * 货主 + */ + @TableField(value = "companyCode") + @ApiModelProperty(value = "货主") + private String companyCode; + + + + /** + * 出库单号 + */ + @TableField(value = "code") + @ApiModelProperty(value = "出库单号") + private String code; + + /** + * erp订单号 + */ + @TableField(value = "referCode") + @ApiModelProperty(value = "erp订单号") + private String referCode; + + /** + * erp订单类型 + */ + @TableField(value = "referCodeType") + @ApiModelProperty(value = "erp订单类型") + private String referCodeType; + + /** + * erp订单内部号 + */ + @TableField(value = "referId") + @ApiModelProperty(value = "erp订单内部号") + private Integer referId; + + /** + * 订单平台 + */ + @TableField(value = "referPlatform") + @ApiModelProperty(value = "订单平台") + private Integer referPlatform; + + /** + * 主状态 + */ + @TableField(value = "firstStatus") + @ApiModelProperty(value = "主状态") + private Integer firstStatus; + + /** + * 拖状态 + */ + @TableField(value = "lastStatus") + @ApiModelProperty(value = "拖状态") + private Integer lastStatus; + + /** + * 出库单类型 + */ + @TableField(value = "shipmentType") + @ApiModelProperty(value = "出库单类型") + private String shipmentType; + + /** + * 路线 + */ + @TableField(value = "route") + @ApiModelProperty(value = "路线") + private String route; + + /** + * 客户编号 + */ + @TableField(value = "customerCode") + @ApiModelProperty(value = "客户编号") + private String customerCode; + + /** + * 客户名称 + */ + @TableField(value = "customerName") + @ApiModelProperty(value = "客户名称") + private String customerName; + + /** + * 优先级 + */ + @TableField(value = "priority") + @ApiModelProperty(value = "优先级") + private Integer priority; + + /** + * 要求到货时间 + */ + @TableField(value = "requestedDeliveryDate") + @ApiModelProperty(value = "要求到货时间") + private Date requestedDeliveryDate; + + + + /** + * 计划发车日期 + */ + @TableField(value = "scheduledShipDate") + @ApiModelProperty(value = "计划发车日期") + private Date scheduledShipDate; + + /** + * 实际发车时间 + */ + @TableField(value = "actualShipDateTime") + @ApiModelProperty(value = "实际发车时间") + private Date actualShipDateTime; + + /** + * 实际到货时间 + */ + @TableField(value = "actualDeliveryDate") + @ApiModelProperty(value = "实际到货时间") + private Date actualDeliveryDate; + + /** + * 配送要求 + */ + @TableField(value = "deliveryNote") + @ApiModelProperty(value = "配送要求") + private String deliveryNote; + + /** + * 失败原因 + */ + @TableField(value = "rejectionNote") + @ApiModelProperty(value = "失败原因") + private String rejectionNote; + + /** + * 波次号 + */ + @TableField(value = "waveId") + @ApiModelProperty(value = "波次号") + private Integer waveId; + + /** + * 发货月台 + */ + @TableField(value = "shipDock") + @ApiModelProperty(value = "发货月台") + private String shipDock; + + /** + * 分配完成 + */ + @TableField(value = "allocateComplete") + @ApiModelProperty(value = "分配完成") + private Integer allocateComplete; + + /** + * 总重量 + */ + @TableField(value = "totalWeight") + @ApiModelProperty(value = "总重量") + private BigDecimal totalWeight; + + /** + * 总数量 + */ + @TableField(value = "totalQty") + @ApiModelProperty(value = "总数量") + private BigDecimal totalQty; + + /** + * 总体积 + */ + @TableField(value = "totalVolume") + @ApiModelProperty(value = "总体积") + private BigDecimal totalVolume; + + /** + * 总行数 + */ + @TableField(value = "totalLines") + @ApiModelProperty(value = "总行数") + private Integer totalLines; + + + + /** + * 处理类型 + */ + @TableField(value = "processType") + @ApiModelProperty(value = "处理类型") + private String processType; + + /** + * 上次波次号 + */ + @TableField(value = "lastWaveId") + @ApiModelProperty(value = "上次波次号") + private Integer lastWaveId; + + /** + * 特征值 + */ + @TableField(value = "signValue") + @ApiModelProperty(value = "特征值") + private String signValue; + + /** + * 承运人 + */ + @TableField(value = "carrierCode") + @ApiModelProperty(value = "承运人") + private String carrierCode; + + /** + * 承运人服务商 + */ + @TableField(value = "carrierService") + @ApiModelProperty(value = "承运人服务商") + private String carrierService; + + /** + * 订单备注 + */ + @TableField(value = "shipmentNote") + @ApiModelProperty(value = "订单备注") + private String shipmentNote; + + /** + * 承运商编码 + */ + @TableField(value = "carrierServer") + @ApiModelProperty(value = "承运商编码") + private String carrierServer; + + /** + * 承运商名称 + */ + @TableField(value = "carrierServerName") + @ApiModelProperty(value = "承运商名称") + private String carrierServerName; + + /** + * 车牌号 + */ + @TableField(value = "plateNumber") + @ApiModelProperty(value = "车牌号") + private String plateNumber; + + /** + * 车型 + */ + @TableField(value = "carModel") + @ApiModelProperty(value = "车型") + private String carModel; + + /** + * 司机名称 + */ + @TableField(value = "driverName") + @ApiModelProperty(value = "司机名称") + private String driverName; + + /** + * 司机联系方式 + */ + @TableField(value = "driverTel") + @ApiModelProperty(value = "司机联系方式") + private String driverTel; + + /** + * 创建时间 + */ + @TableField(value = "created") + @ApiModelProperty(value = "创建时间") + private Date created; + + /** + * 创建用户 + */ + @TableField(value = "createdBy") + @ApiModelProperty(value = "创建用户") + private String createdBy; + + /** + * 创建时间 + */ + @TableField(value = "lastUpdated") + @ApiModelProperty(value = "创建时间") + private Date lastUpdated; + + /** + * 更新用户 + */ + @TableField(value = "lastUpdatedBy") + @ApiModelProperty(value = "更新用户") + private String lastUpdatedBy; + + /** + * 数据版本 + */ + @TableField(value = "version") + @ApiModelProperty(value = "数据版本") + private Integer version; + + /** + * 自定义字段1 + */ + @TableField(value = "userDef1") + @ApiModelProperty(value = "自定义字段1") + private String userDef1; + + /** + * 自定义字段2 + */ + @TableField(value = "userDef2") + @ApiModelProperty(value = "自定义字段2") + private String userDef2; + + /** + * 自定义字段3 + */ + @TableField(value = "userDef3") + @ApiModelProperty(value = "自定义字段3") + private String userDef3; + /** + * 处理标记 + */ + @TableField(value = "processStamp") + @ApiModelProperty(value = "处理标记") + private String processStamp; + + /** + * 是否删除 + */ + @TableField(value = "deleted") + @ApiModelProperty(value = "是否删除") + private Boolean deleted; + + private static final long serialVersionUID = 1L; + + public static final String COL_WAREHOUSECODE = "warehouseCode"; + + public static final String COL_COMPANYCODE = "companyCode"; + + public static final String COL_CODE = "code"; + + public static final String COL_REFERCODE = "referCode"; + + public static final String COL_REFERCODETYPE = "referCodeType"; + + public static final String COL_REFERID = "referId"; + + public static final String COL_REFERPLATFORM = "referPlatform"; + + public static final String COL_FIRSTSTATUS = "firstStatus"; + + public static final String COL_LASTSTATUS = "lastStatus"; + + public static final String COL_SHIPMENTTYPE = "shipmentType"; + + public static final String COL_ROUTE = "route"; + + public static final String COL_CUSTOMERCODE = "customerCode"; + + public static final String COL_CUSTOMERNAME = "customerName"; + + public static final String COL_PRIORITY = "priority"; + + public static final String COL_REQUESTEDDELIVERYDATE = "requestedDeliveryDate"; + + public static final String COL_SCHEDULEDSHIPDATE = "scheduledShipDate"; + + public static final String COL_ACTUALSHIPDATETIME = "actualShipDateTime"; + + public static final String COL_ACTUALDELIVERYDATE = "actualDeliveryDate"; + + public static final String COL_DELIVERYNOTE = "deliveryNote"; + + public static final String COL_REJECTIONNOTE = "rejectionNote"; + + public static final String COL_WAVEID = "waveId"; + + public static final String COL_SHIPDOCK = "shipDock"; + + public static final String COL_ALLOCATECOMPLETE = "allocateComplete"; + + public static final String COL_TOTALWEIGHT = "totalWeight"; + + public static final String COL_TOTALQTY = "totalQty"; + + public static final String COL_TOTALVOLUME = "totalVolume"; + + public static final String COL_TOTALLINES = "totalLines"; + + public static final String COL_PROCESSTYPE = "processType"; + + public static final String COL_LASTWAVEID = "lastWaveId"; + + public static final String COL_SIGNVALUE = "signValue"; + + public static final String COL_CARRIERCODE = "carrierCode"; + + public static final String COL_CARRIERSERVICE = "carrierService"; + + public static final String COL_SHIPMENTNOTE = "shipmentNote"; + + public static final String COL_CARRIERSERVER = "carrierServer"; + + public static final String COL_CARRIERSERVERNAME = "carrierServerName"; + + public static final String COL_PLATENUMBER = "plateNumber"; + + public static final String COL_CARMODEL = "carModel"; + + public static final String COL_DRIVERNAME = "driverName"; + + public static final String COL_DRIVERTEL = "driverTel"; + + public static final String COL_CREATED = "created"; + + public static final String COL_CREATEDBY = "createdBy"; + + public static final String COL_LASTUPDATED = "lastUpdated"; + + public static final String COL_LASTUPDATEDBY = "lastUpdatedBy"; + + public static final String COL_VERSION = "version"; + + public static final String COL_USERDEF1 = "userDef1"; + + public static final String COL_USERDEF2 = "userDef2"; + + public static final String COL_USERDEF3 = "userDef3"; + + public static final String COL_PROCESSSTAMP = "processStamp"; + + public static final String COL_DELETED = "deleted"; +} \ No newline at end of file diff --git a/src/main/java/com/huaheng/pc/shipment/shipmentHeaderHistory/mapper/ShipmentHeaderHistoryMapper.java b/src/main/java/com/huaheng/pc/shipment/shipmentHeaderHistory/mapper/ShipmentHeaderHistoryMapper.java new file mode 100644 index 0000000..1acc14f --- /dev/null +++ b/src/main/java/com/huaheng/pc/shipment/shipmentHeaderHistory/mapper/ShipmentHeaderHistoryMapper.java @@ -0,0 +1,10 @@ +package com.huaheng.pc.shipment.shipmentHeaderHistory.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.huaheng.pc.shipment.shipmentHeaderHistory.domain.ShipmentHeaderHistory; + +public interface ShipmentHeaderHistoryMapper extends BaseMapper<ShipmentHeaderHistory> { + + + +} \ No newline at end of file diff --git a/src/main/java/com/huaheng/pc/shipment/shipmentHeaderHistory/service/ShipmentHeaderHistoryService.java b/src/main/java/com/huaheng/pc/shipment/shipmentHeaderHistory/service/ShipmentHeaderHistoryService.java new file mode 100644 index 0000000..476eda0 --- /dev/null +++ b/src/main/java/com/huaheng/pc/shipment/shipmentHeaderHistory/service/ShipmentHeaderHistoryService.java @@ -0,0 +1,9 @@ +package com.huaheng.pc.shipment.shipmentHeaderHistory.service; + +import com.baomidou.mybatisplus.extension.service.IService; +import com.huaheng.pc.shipment.shipmentHeaderHistory.domain.ShipmentHeaderHistory; + +public interface ShipmentHeaderHistoryService extends IService<ShipmentHeaderHistory>{ + + +} diff --git a/src/main/java/com/huaheng/pc/shipment/shipmentHeaderHistory/service/ShipmentHeaderHistoryServiceImpl.java b/src/main/java/com/huaheng/pc/shipment/shipmentHeaderHistory/service/ShipmentHeaderHistoryServiceImpl.java new file mode 100644 index 0000000..b3eebab --- /dev/null +++ b/src/main/java/com/huaheng/pc/shipment/shipmentHeaderHistory/service/ShipmentHeaderHistoryServiceImpl.java @@ -0,0 +1,13 @@ +package com.huaheng.pc.shipment.shipmentHeaderHistory.service; + + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.huaheng.pc.shipment.shipmentHeaderHistory.domain.ShipmentHeaderHistory; +import com.huaheng.pc.shipment.shipmentHeaderHistory.mapper.ShipmentHeaderHistoryMapper; +import org.springframework.stereotype.Service; + + +@Service +public class ShipmentHeaderHistoryServiceImpl extends ServiceImpl<ShipmentHeaderHistoryMapper, ShipmentHeaderHistory> implements ShipmentHeaderHistoryService { + +} diff --git a/src/main/resources/mybatis/config/MaterialTypeMapper.xml b/src/main/resources/mybatis/config/MaterialTypeMapper.xml new file mode 100644 index 0000000..148e900 --- /dev/null +++ b/src/main/resources/mybatis/config/MaterialTypeMapper.xml @@ -0,0 +1,51 @@ +<?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="com.huaheng.pc.config.materialType.mapper.MaterialTypeMapper"> + <resultMap id="BaseResultMap" type="com.huaheng.pc.config.materialType.domain.MaterialType"> + <!--@mbg.generated--> + <id column="id" jdbcType="INTEGER" property="id" /> + <result column="code" jdbcType="VARCHAR" property="code" /> + <result column="name" jdbcType="VARCHAR" property="name" /> + <result column="companyCode" jdbcType="VARCHAR" property="companyCode" /> + <result column="warehouseCode" jdbcType="VARCHAR" property="warehouseCode" /> + <result column="abcClass" jdbcType="VARCHAR" property="abcClass" /> + <result column="daysToExpire" jdbcType="INTEGER" property="daysToExpire" /> + <result column="receivingFlow" jdbcType="VARCHAR" property="receivingFlow" /> + <result column="shippingFlow" jdbcType="VARCHAR" property="shippingFlow" /> + <result column="locatingRule" jdbcType="VARCHAR" property="locatingRule" /> + <result column="allocationRule" jdbcType="VARCHAR" property="allocationRule" /> + <result column="replenishmentRule" jdbcType="VARCHAR" property="replenishmentRule" /> + <result column="emptyLocRule" jdbcType="VARCHAR" property="emptyLocRule" /> + <result column="pickingRule" jdbcType="VARCHAR" property="pickingRule" /> + <result column="attributeTemplateCode" jdbcType="VARCHAR" property="attributeTemplateCode" /> + <result column="trackSerialNum" jdbcType="INTEGER" property="trackSerialNum" /> + <result column="autoGenSerialNum" jdbcType="INTEGER" property="autoGenSerialNum" /> + <result column="autoGenSerialNumFormat" jdbcType="VARCHAR" property="autoGenSerialNumFormat" /> + <result column="snTemplateCode" jdbcType="VARCHAR" property="snTemplateCode" /> + <result column="expiringDays" jdbcType="INTEGER" property="expiringDays" /> + <result column="minShelfLifeDays" jdbcType="INTEGER" property="minShelfLifeDays" /> + <result column="enable" jdbcType="INTEGER" property="enable" /> + <result column="created" jdbcType="TIMESTAMP" property="created" /> + <result column="createdBy" jdbcType="VARCHAR" property="createdBy" /> + <result column="lastUpdated" jdbcType="TIMESTAMP" property="lastUpdated" /> + <result column="lastUpdatedBy" jdbcType="VARCHAR" property="lastUpdatedBy" /> + <result column="version" jdbcType="INTEGER" property="version" /> + <result column="userDef1" jdbcType="VARCHAR" property="userDef1" /> + <result column="userDef2" jdbcType="VARCHAR" property="userDef2" /> + <result column="userDef3" jdbcType="VARCHAR" property="userDef3" /> + <result column="userDef4" jdbcType="VARCHAR" property="userDef4" /> + <result column="userDef5" jdbcType="VARCHAR" property="userDef5" /> + <result column="userDef6" jdbcType="VARCHAR" property="userDef6" /> + <result column="userDef7" jdbcType="VARCHAR" property="userDef7" /> + <result column="userDef8" jdbcType="VARCHAR" property="userDef8" /> + </resultMap> + <sql id="Base_Column_List"> + <!--@mbg.generated--> + id, code, `name`, companyCode, warehouseCode, abcClass, daysToExpire, receivingFlow, + shippingFlow, locatingRule, allocationRule, replenishmentRule, emptyLocRule, pickingRule, + attributeTemplateCode, trackSerialNum, autoGenSerialNum, autoGenSerialNumFormat, + snTemplateCode, expiringDays, minShelfLifeDays, `enable`, created, createdBy, lastUpdated, + lastUpdatedBy, version, userDef1, userDef2, userDef3, userDef4, userDef5, userDef6, + userDef7, userDef8 + </sql> +</mapper> \ No newline at end of file diff --git a/src/main/resources/mybatis/shipment/ShipmentDetailHistoryMapper.xml b/src/main/resources/mybatis/shipment/ShipmentDetailHistoryMapper.xml new file mode 100644 index 0000000..cd482f0 --- /dev/null +++ b/src/main/resources/mybatis/shipment/ShipmentDetailHistoryMapper.xml @@ -0,0 +1,78 @@ +<?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="com.huaheng.pc.shipment.shipmentDetailHistory.mapper.ShipmentDetailHistoryMapper"> + <resultMap id="BaseResultMap" type="com.huaheng.pc.shipment.shipmentDetailHistory.domain.ShipmentDetailHistory"> + <!--@mbg.generated--> + <id column="id" jdbcType="INTEGER" property="id" /> + <result column="shipmentId" jdbcType="INTEGER" property="shipmentId" /> + <result column="warehouseCode" jdbcType="VARCHAR" property="warehouseCode" /> + <result column="companyCode" jdbcType="VARCHAR" property="companyCode" /> + <result column="shipmentCode" jdbcType="VARCHAR" property="shipmentCode" /> + <result column="referCode" jdbcType="VARCHAR" property="referCode" /> + <result column="referId" jdbcType="INTEGER" property="referId" /> + <result column="referLineNum" jdbcType="VARCHAR" property="referLineNum" /> + <result column="materialCode" jdbcType="VARCHAR" property="materialCode" /> + <result column="materialName" jdbcType="VARCHAR" property="materialName" /> + <result column="materialSpec" jdbcType="VARCHAR" property="materialSpec" /> + <result column="materialUnit" jdbcType="VARCHAR" property="materialUnit" /> + <result column="shipQty" jdbcType="INTEGER" property="shipQty" /> + <result column="requestQty" jdbcType="INTEGER" property="requestQty" /> + <result column="allocationRule" jdbcType="VARCHAR" property="allocationRule" /> + <result column="replenishmentRule" jdbcType="VARCHAR" property="replenishmentRule" /> + <result column="pickLocs" jdbcType="VARCHAR" property="pickLocs" /> + <result column="attribute1" jdbcType="VARCHAR" property="attribute1" /> + <result column="attribute2" jdbcType="VARCHAR" property="attribute2" /> + <result column="attribute3" jdbcType="VARCHAR" property="attribute3" /> + <result column="attribute4" jdbcType="VARCHAR" property="attribute4" /> + <result column="batch" jdbcType="VARCHAR" property="batch" /> + <result column="lot" jdbcType="VARCHAR" property="lot" /> + <result column="projectNo" jdbcType="VARCHAR" property="projectNo" /> + <result column="manufactureDate" jdbcType="DATE" property="manufactureDate" /> + <result column="expirationDate" jdbcType="DATE" property="expirationDate" /> + <result column="agingDate" jdbcType="DATE" property="agingDate" /> + <result column="inventorySts" jdbcType="VARCHAR" property="inventorySts" /> + <result column="dockLoc" jdbcType="VARCHAR" property="dockLoc" /> + <result column="packingClass" jdbcType="VARCHAR" property="packingClass" /> + <result column="status" jdbcType="INTEGER" property="status" /> + <result column="waveId" jdbcType="INTEGER" property="waveId" /> + <result column="created" jdbcType="TIMESTAMP" property="created" /> + <result column="createdBy" jdbcType="VARCHAR" property="createdBy" /> + <result column="lastUpdated" jdbcType="TIMESTAMP" property="lastUpdated" /> + <result column="lastUpdatedBy" jdbcType="VARCHAR" property="lastUpdatedBy" /> + <result column="version" jdbcType="INTEGER" property="version" /> + <result column="userDef1" jdbcType="VARCHAR" property="userDef1" /> + <result column="userDef2" jdbcType="VARCHAR" property="userDef2" /> + <result column="userDef3" jdbcType="VARCHAR" property="userDef3" /> + <result column="processStamp" jdbcType="VARCHAR" property="processStamp" /> + </resultMap> + <sql id="Base_Column_List"> + <!--@mbg.generated--> + id, shipmentId, warehouseCode, companyCode, shipmentCode, referCode, referId, referLineNum, + materialCode, materialName, materialSpec, materialUnit, shipQty, requestQty, allocationRule, + replenishmentRule, pickLocs, attribute1, attribute2, attribute3, attribute4, batch, + lot, projectNo, manufactureDate, expirationDate, agingDate, inventorySts, dockLoc, + packingClass, `enable`, waveId, created, createdBy, lastUpdated, lastUpdatedBy, version, + userDef1, userDef2, userDef3,processStamp + </sql> + + <select id="SelectFirstStatus" resultType="java.util.Map"> + SELECT h.id, h.firstStatus + FROM shipment_header_history h + INNER JOIN shipment_detail_history d ON h.id = d.shipmentId AND d.id IN (#{ids}) + GROUP BY h.id,firstStatus + </select> + + <delete id="batchDelete"> + DELETE FROM shipment_detail_history WHERE id IN + <foreach item="idItem" collection="array" open="(" separator="," close=")"> + #{idItem} + </foreach> + </delete> + + <select id="StatisticalByReceiptId" resultType="java.util.Map"> + SELECT count(*) as 'totalLines',sum(shipQty) as 'totalQty' + FROM shipment_detail_history + WHERE shipmentId=#{headerId} + </select> + +</mapper> \ No newline at end of file diff --git a/src/main/resources/mybatis/shipment/ShipmentDetailMapper.xml b/src/main/resources/mybatis/shipment/ShipmentDetailMapper.xml index 24fda54..539503a 100644 --- a/src/main/resources/mybatis/shipment/ShipmentDetailMapper.xml +++ b/src/main/resources/mybatis/shipment/ShipmentDetailMapper.xml @@ -43,11 +43,6 @@ <result column="userDef1" jdbcType="VARCHAR" property="userDef1" /> <result column="userDef2" jdbcType="VARCHAR" property="userDef2" /> <result column="userDef3" jdbcType="VARCHAR" property="userDef3" /> - <result column="userDef4" jdbcType="VARCHAR" property="userDef4" /> - <result column="userDef5" jdbcType="VARCHAR" property="userDef5" /> - <result column="userDef6" jdbcType="VARCHAR" property="userDef6" /> - <result column="userDef7" jdbcType="VARCHAR" property="userDef7" /> - <result column="userDef8" jdbcType="VARCHAR" property="userDef8" /> <result column="processStamp" jdbcType="VARCHAR" property="processStamp" /> </resultMap> <sql id="Base_Column_List"> @@ -57,7 +52,7 @@ replenishmentRule, pickLocs, attribute1, attribute2, attribute3, attribute4, batch, lot, projectNo, manufactureDate, expirationDate, agingDate, inventorySts, dockLoc, packingClass, `enable`, waveId, created, createdBy, lastUpdated, lastUpdatedBy, version, - userDef1, userDef2, userDef3, userDef4, userDef5, userDef6, userDef7, userDef8, processStamp + userDef1, userDef2, userDef3,processStamp </sql> diff --git a/src/main/resources/mybatis/shipment/ShipmentHeaderHistoryMapper.xml b/src/main/resources/mybatis/shipment/ShipmentHeaderHistoryMapper.xml new file mode 100644 index 0000000..2f6327c --- /dev/null +++ b/src/main/resources/mybatis/shipment/ShipmentHeaderHistoryMapper.xml @@ -0,0 +1,70 @@ +<?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="com.huaheng.pc.shipment.shipmentHeaderHistory.mapper.ShipmentHeaderHistoryMapper"> + <resultMap id="BaseResultMap" type="com.huaheng.pc.shipment.shipmentHeaderHistory.domain.ShipmentHeaderHistory"> + <!--@mbg.generated--> + <id column="id" jdbcType="INTEGER" property="id" /> + <result column="warehouseCode" jdbcType="VARCHAR" property="warehouseCode" /> + <result column="companyCode" jdbcType="VARCHAR" property="companyCode" /> + <result column="code" jdbcType="VARCHAR" property="code" /> + <result column="referCode" jdbcType="VARCHAR" property="referCode" /> + <result column="referCodeType" jdbcType="VARCHAR" property="referCodeType" /> + <result column="referId" jdbcType="INTEGER" property="referId" /> + <result column="referPlatform" jdbcType="INTEGER" property="referPlatform" /> + <result column="firstStatus" jdbcType="INTEGER" property="firstStatus" /> + <result column="lastStatus" jdbcType="INTEGER" property="lastStatus" /> + <result column="shipmentType" jdbcType="VARCHAR" property="shipmentType" /> + <result column="route" jdbcType="VARCHAR" property="route" /> + <result column="customerCode" jdbcType="VARCHAR" property="customerCode" /> + <result column="customerName" jdbcType="VARCHAR" property="customerName" /> + <result column="priority" jdbcType="INTEGER" property="priority" /> + <result column="requestedDeliveryDate" jdbcType="DATE" property="requestedDeliveryDate" /> + <result column="scheduledShipDate" jdbcType="DATE" property="scheduledShipDate" /> + <result column="actualShipDateTime" jdbcType="TIMESTAMP" property="actualShipDateTime" /> + <result column="actualDeliveryDate" jdbcType="DATE" property="actualDeliveryDate" /> + <result column="deliveryNote" jdbcType="VARCHAR" property="deliveryNote" /> + <result column="rejectionNote" jdbcType="VARCHAR" property="rejectionNote" /> + <result column="waveId" jdbcType="INTEGER" property="waveId" /> + <result column="shipDock" jdbcType="VARCHAR" property="shipDock" /> + <result column="allocateComplete" jdbcType="INTEGER" property="allocateComplete" /> + <result column="totalWeight" jdbcType="DECIMAL" property="totalWeight" /> + <result column="totalQty" jdbcType="INTEGER" property="totalQty" /> + <result column="totalVolume" jdbcType="DECIMAL" property="totalVolume" /> + <result column="totalLines" jdbcType="INTEGER" property="totalLines" /> + <result column="processType" jdbcType="VARCHAR" property="processType" /> + <result column="lastWaveId" jdbcType="INTEGER" property="lastWaveId" /> + <result column="signValue" jdbcType="VARCHAR" property="signValue" /> + <result column="carrierCode" jdbcType="VARCHAR" property="carrierCode" /> + <result column="carrierService" jdbcType="VARCHAR" property="carrierService" /> + <result column="shipmentNote" jdbcType="VARCHAR" property="shipmentNote" /> + <result column="carrierServer" jdbcType="VARCHAR" property="carrierServer" /> + <result column="carrierServerName" jdbcType="VARCHAR" property="carrierServerName" /> + <result column="plateNumber" jdbcType="VARCHAR" property="plateNumber" /> + <result column="carModel" jdbcType="VARCHAR" property="carModel" /> + <result column="driverName" jdbcType="VARCHAR" property="driverName" /> + <result column="driverTel" jdbcType="VARCHAR" property="driverTel" /> + <result column="created" jdbcType="TIMESTAMP" property="created" /> + <result column="createdBy" jdbcType="VARCHAR" property="createdBy" /> + <result column="lastUpdated" jdbcType="TIMESTAMP" property="lastUpdated" /> + <result column="lastUpdatedBy" jdbcType="VARCHAR" property="lastUpdatedBy" /> + <result column="version" jdbcType="INTEGER" property="version" /> + <result column="userDef1" jdbcType="VARCHAR" property="userDef1" /> + <result column="userDef2" jdbcType="VARCHAR" property="userDef2" /> + <result column="userDef3" jdbcType="VARCHAR" property="userDef3" /> + <result column="processStamp" jdbcType="VARCHAR" property="processStamp" /> + <result column="deleted" jdbcType="BIT" property="deleted" /> + </resultMap> + <sql id="Base_Column_List"> + <!--@mbg.generated--> + id, warehouseCode, companyCode, code, referCode, referCodeType, referId, + referPlatform, firstStatus, lastStatus, shipmentType, route, customerCode, customerName, + priority, requestedDeliveryDate, scheduledShipDate, actualShipDateTime, + actualDeliveryDate, deliveryNote, rejectionNote, waveId, shipDock, allocateComplete, + totalWeight, totalQty, totalVolume, totalLines, + processType, lastWaveId, signValue, carrierCode, carrierService, shipmentNote, carrierServer, + carrierServerName, plateNumber, carModel, driverName, driverTel, created, createdBy, + lastUpdated, lastUpdatedBy, version, userDef1, userDef2, userDef3,processStamp, deleted + </sql> + + +</mapper> \ No newline at end of file diff --git a/src/main/resources/mybatis/shipment/ShipmentHeaderMapper.xml b/src/main/resources/mybatis/shipment/ShipmentHeaderMapper.xml index 1e8433c..51a802d 100644 --- a/src/main/resources/mybatis/shipment/ShipmentHeaderMapper.xml +++ b/src/main/resources/mybatis/shipment/ShipmentHeaderMapper.xml @@ -51,11 +51,6 @@ <result column="userDef1" jdbcType="VARCHAR" property="userDef1" /> <result column="userDef2" jdbcType="VARCHAR" property="userDef2" /> <result column="userDef3" jdbcType="VARCHAR" property="userDef3" /> - <result column="userDef4" jdbcType="VARCHAR" property="userDef4" /> - <result column="userDef5" jdbcType="VARCHAR" property="userDef5" /> - <result column="userDef6" jdbcType="VARCHAR" property="userDef6" /> - <result column="userDef7" jdbcType="VARCHAR" property="userDef7" /> - <result column="userDef8" jdbcType="VARCHAR" property="userDef8" /> <result column="processStamp" jdbcType="VARCHAR" property="processStamp" /> <result column="deleted" jdbcType="BIT" property="deleted" /> </resultMap> @@ -68,8 +63,7 @@ totalWeight, totalQty, totalVolume, totalLines, processType, lastWaveId, signValue, carrierCode, carrierService, shipmentNote, carrierServer, carrierServerName, plateNumber, carModel, driverName, driverTel, created, createdBy, - lastUpdated, lastUpdatedBy, version, userDef1, userDef2, userDef3, userDef4, userDef5, - userDef6, userDef7, userDef8, processStamp, deleted + lastUpdated, lastUpdatedBy, version, userDef1, userDef2, userDef3,processStamp, deleted </sql> <select id="createCode" resultType="java.lang.String"> diff --git a/src/main/resources/templates/config/statusFlowDetail/add.html b/src/main/resources/templates/config/statusFlowDetail/add.html index bbd23b6..3c5d9c3 100644 --- a/src/main/resources/templates/config/statusFlowDetail/add.html +++ b/src/main/resources/templates/config/statusFlowDetail/add.html @@ -6,6 +6,7 @@ <div class="wrapper wrapper-content animated fadeInRight ibox-content"> <form class="form-horizontal m" id="form-statusFlowDetails-add"> <input name="headerId" type="hidden" th:value="${headerId}"> + <input name="headerCode" type="hidden" th:value="${headerCode}"> <div class="form-group"> <label class="col-sm-3 control-label">状态流:</label> <div class="col-sm-8"> diff --git a/src/main/resources/templates/receipt/receiptDetail/receiptDetail.html b/src/main/resources/templates/receipt/receiptDetail/receiptDetail.html index 59e2aa8..d544e18 100644 --- a/src/main/resources/templates/receipt/receiptDetail/receiptDetail.html +++ b/src/main/resources/templates/receipt/receiptDetail/receiptDetail.html @@ -51,6 +51,7 @@ <script th:inline="javascript"> var editFlag = [[${@permission.hasPermi('receipt:receiptDetail:edit')}]]; var removeFlag = [[${@permission.hasPermi('receipt:receiptDetail:remove')}]]; + var approvalFlag = [[${@permission.hasPermi('receipt:receiptHeader:approval')}]] var prefix = ctx + "receipt/receiptDetail"; var datas = [[${@dict.getType('isVirtualBom')}]]; $(function() { @@ -218,6 +219,11 @@ align: 'center', formatter: function(value, row, index) { var actions = []; + if (row.processStamp == 5){ + actions.push('<a class="btn btn-success btn-xs ' + approvalFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')">审核通过</a> '); + actions.push('<a class="btn btn-warning btn-xs ' + approvalFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')">驳回</a>'); + actions.push('<a class="btn btn-danger btn-xs ' + approvalFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')">作废</a>'); + } actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="#" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> '); actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="#" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-trash-o"></i>删除</a>'); return actions.join(''); diff --git a/src/main/resources/templates/receipt/receiptHeader/add.html b/src/main/resources/templates/receipt/receiptHeader/add.html index 9140218..d5a02b9 100644 --- a/src/main/resources/templates/receipt/receiptHeader/add.html +++ b/src/main/resources/templates/receipt/receiptHeader/add.html @@ -64,7 +64,7 @@ url : prefix + "/add", data : { "receiptType": $("#receiptType option:selected").val(), - "companyCode": $("#company option:selected").attr("code"), + "companyCode": $("#company option:selected").val(), "receiptNote": $("input[name='receiptNote']").val(), "scheduledArriveDate": $("input[name='scheduledArriveDate']").val(), }, diff --git a/src/main/resources/templates/shipment/shipmentHeaderHistory/shipmentHeaderHistory.html b/src/main/resources/templates/shipment/shipmentHeaderHistory/shipmentHeaderHistory.html index 55622b3..fc08b07 100644 --- a/src/main/resources/templates/shipment/shipmentHeaderHistory/shipmentHeaderHistory.html +++ b/src/main/resources/templates/shipment/shipmentHeaderHistory/shipmentHeaderHistory.html @@ -20,7 +20,7 @@ <div id="myTabContent" class="tab-content"> <div class="tab-pane fade in active" id="tabHeader"> <div class="col-sm-12 select-info"> - <form id="receiptHeader-form"> + <form id="shipmentHeaderHistory-form"> <div class="select-list"> <ul> <li>