From 576a1834decbfc8a94e3236271bd82c62c989e56 Mon Sep 17 00:00:00 2001 From: liukewei Date: Tue, 5 Dec 2023 15:55:00 +0800 Subject: [PATCH] =?UTF-8?q?=E7=89=A9=E8=B5=84=E7=AE=A1=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ehs/EhsMaterialDetailController.java | 127 ++++++ .../src/main/resources/application.yml | 2 +- .../ruoyi/common/core/domain/BaseEntity.java | 1 + .../ruoyi/ehsMaterial/domain/EhsMaterial.java | 5 +- .../service/impl/EhsMaterialServiceImpl.java | 5 + .../domain/EhsMaterialDetail.java | 70 ++++ .../mapper/EhsMaterialDetailMapper.java | 37 ++ .../service/IEhsMaterialDetailService.java | 37 ++ .../impl/EhsMaterialDetailServiceImpl.java | 76 ++++ .../service/impl/EhsRiskServiceImpl.java | 2 +- .../mapper/ehs/EhsMaterialDetailMapper.xml | 57 +++ .../mapper/ehs/EhsMaterialMapper.xml | 9 +- ruoyi-ui/src/api/ehs/EhsMaterialDetail.js | 44 +++ .../src/views/ehs/EhsMaterialDetail/index.vue | 366 ++++++++++++++++++ ruoyi-ui/src/views/ehs/ehsMaterial/index.vue | 211 +++++++++- ruoyi-ui/src/views/ehs/ehsRisk/index.vue | 6 +- ruoyi-ui/vue.config.js | 2 +- 17 files changed, 1033 insertions(+), 24 deletions(-) create mode 100644 ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsMaterialDetailController.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsMaterialDetail/domain/EhsMaterialDetail.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsMaterialDetail/mapper/EhsMaterialDetailMapper.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsMaterialDetail/service/IEhsMaterialDetailService.java create mode 100644 ruoyi-system/src/main/java/com/ruoyi/ehsMaterialDetail/service/impl/EhsMaterialDetailServiceImpl.java create mode 100644 ruoyi-system/src/main/resources/mapper/ehs/EhsMaterialDetailMapper.xml create mode 100644 ruoyi-ui/src/api/ehs/EhsMaterialDetail.js create mode 100644 ruoyi-ui/src/views/ehs/EhsMaterialDetail/index.vue diff --git a/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsMaterialDetailController.java b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsMaterialDetailController.java new file mode 100644 index 0000000..ad53724 --- /dev/null +++ b/ruoyi-admin/src/main/java/com/ruoyi/web/controller/ehs/EhsMaterialDetailController.java @@ -0,0 +1,127 @@ +package com.ruoyi.web.controller.ehs; + +import java.util.Date; +import java.util.List; +import java.util.Arrays; +import javax.servlet.http.HttpServletResponse; + +import com.ruoyi.common.utils.SecurityUtils; +import com.ruoyi.ehsMaterial.domain.EhsMaterial; +import com.ruoyi.ehsMaterial.service.IEhsMaterialService; +import org.springframework.security.access.prepost.PreAuthorize; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.GetMapping; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.PutMapping; +import org.springframework.web.bind.annotation.DeleteMapping; +import org.springframework.web.bind.annotation.PathVariable; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import io.swagger.annotations.Api; +import io.swagger.annotations.ApiOperation; +import com.ruoyi.common.annotation.Log; +import com.ruoyi.common.core.controller.BaseController; +import com.ruoyi.common.core.domain.AjaxResult; +import com.ruoyi.common.enums.BusinessType; +import com.ruoyi.ehsMaterialDetail.domain.EhsMaterialDetail; +import com.ruoyi.ehsMaterialDetail.service.IEhsMaterialDetailService; +import com.ruoyi.common.utils.poi.ExcelUtil; +import com.ruoyi.common.core.page.TableDataInfo; + +/** + * 资源管理出库入库明细Controller + * + * @author ruoyi + * @date 2023-12-05 + */ +@Api(tags="资源管理出库入库明细管理") +@RestController +@RequestMapping("/EhsMaterialDetail/EhsMaterialDetail") +public class EhsMaterialDetailController extends BaseController +{ + @Autowired + private IEhsMaterialDetailService ehsMaterialDetailService; + @Autowired + private IEhsMaterialService ehsMaterialService; +/** + * 查询资源管理出库入库明细列表 + */ +@PreAuthorize("@ss.hasPermi('EhsMaterialDetail:EhsMaterialDetail:list')") +@GetMapping("/list") + public TableDataInfo list(EhsMaterialDetail ehsMaterialDetail) + { + startPage(); + List list = ehsMaterialDetailService.selectEhsMaterialDetailList(ehsMaterialDetail); + return getDataTable(list); + } + + /** + * 导出资源管理出库入库明细列表 + */ + @PreAuthorize("@ss.hasPermi('EhsMaterialDetail:EhsMaterialDetail:export')") + @Log(title = "资源管理出库入库明细", businessType = BusinessType.EXPORT) + @PostMapping("/export") + public void export(HttpServletResponse response, EhsMaterialDetail ehsMaterialDetail) + { + List list = ehsMaterialDetailService.selectEhsMaterialDetailList(ehsMaterialDetail); + ExcelUtil util = new ExcelUtil(EhsMaterialDetail.class); + util.exportExcel(response, list, "资源管理出库入库明细数据"); + } + + /** + * 获取资源管理出库入库明细详细信息 + */ + @PreAuthorize("@ss.hasPermi('EhsMaterialDetail:EhsMaterialDetail:query')") + @GetMapping(value = "/{materialDetailId}") + public AjaxResult getInfo(@PathVariable("materialDetailId") Long materialDetailId) + { + return success(ehsMaterialDetailService.selectEhsMaterialDetailByMaterialDetailId(materialDetailId)); + } + + /** + * 新增资源管理出库入库明细 + */ + @ApiOperation("新增资源管理出库入库明细") + @PreAuthorize("@ss.hasPermi('EhsMaterialDetail:EhsMaterialDetail:add')") + @Log(title = "资源管理出库入库明细", businessType = BusinessType.INSERT) + @PostMapping + public AjaxResult add(@RequestBody EhsMaterialDetail ehsMaterialDetail) + { + ehsMaterialDetail.setSendTime(new Date()); + ehsMaterialDetail.setSendUserId(SecurityUtils.getUserId()); + return toAjax(ehsMaterialDetailService.save(ehsMaterialDetail)); + } + + /** + * 修改资源管理出库入库明细 + */ + @ApiOperation("执行出库指令") + @PreAuthorize("@ss.hasPermi('EhsMaterialDetail:EhsMaterialDetail:edit')") + @Log(title = "执行出库指令", businessType = BusinessType.UPDATE) + @PutMapping + public AjaxResult edit(@RequestBody EhsMaterialDetail ehsMaterialDetail) + { + ehsMaterialDetail.setOutboundTime(new Date()); + ehsMaterialDetail.setOutboundUserId(SecurityUtils.getUserId()); + EhsMaterialDetail md = ehsMaterialDetailService.selectEhsMaterialDetailByMaterialDetailId(ehsMaterialDetail.getMaterialDetailId()); + ehsMaterialDetail.setOutboundQuantity(md.getOutboundQuantity()) ; + //更新物资表数量 + EhsMaterial ehsMaterial = ehsMaterialService.selectEhsMaterialByMaterialId(ehsMaterialDetail.getMaterialDetailId()); + ehsMaterial.setMaterialQuantity(String.valueOf(Long.parseLong(ehsMaterial.getMaterialQuantity())- Long.parseLong(md.getSendQuantity()) )); + return toAjax(ehsMaterialDetailService.updateById(ehsMaterialDetail)); + } + + /** + * 删除资源管理出库入库明细 + */ + @ApiOperation("按物资表删除未执行出库指令") + @PreAuthorize("@ss.hasPermi('EhsMaterialDetail:EhsMaterialDetail:remove')") + @Log(title = "按物资表删除未执行出库指令", businessType = BusinessType.DELETE) + @DeleteMapping("/{materialDetailIds}") + public AjaxResult remove(@PathVariable Long materialId) + { + //return toAjax(ehsMaterialDetailService.removeByIds(Arrays.asList(materialDetailIds))); + return toAjax(ehsMaterialDetailService.deleteEhsMaterialDetailByMaterialId(materialId)); + } +} diff --git a/ruoyi-admin/src/main/resources/application.yml b/ruoyi-admin/src/main/resources/application.yml index d73f497..7919ea1 100644 --- a/ruoyi-admin/src/main/resources/application.yml +++ b/ruoyi-admin/src/main/resources/application.yml @@ -18,7 +18,7 @@ ruoyi: # 开发环境配置 server: # 服务器的HTTP端口,默认为8080 - port: 8080 + port: 8083 servlet: # 应用的访问路径 context-path: / diff --git a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java index 74dec0a..5b75c06 100644 --- a/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java +++ b/ruoyi-common/src/main/java/com/ruoyi/common/core/domain/BaseEntity.java @@ -38,6 +38,7 @@ public class BaseEntity implements Serializable private Long deptId; /** 上报部门 */ @Excel(name = "上报部门") + @TableField(exist = false) private String deptName; /** 创建时间 */ @TableField(fill = FieldFill.INSERT) diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/domain/EhsMaterial.java b/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/domain/EhsMaterial.java index be5b6af..1731a1c 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/domain/EhsMaterial.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/domain/EhsMaterial.java @@ -65,7 +65,10 @@ public class EhsMaterial extends BaseEntity /** 联系电话 */ @Excel(name = "联系电话") private String tel; - + /** 上报部门 */ + @Excel(name = "待处理出库") + @TableField(exist = false) + private String sendQuantity; } diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/service/impl/EhsMaterialServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/service/impl/EhsMaterialServiceImpl.java index 0155774..f452cba 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/service/impl/EhsMaterialServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsMaterial/service/impl/EhsMaterialServiceImpl.java @@ -3,6 +3,7 @@ package com.ruoyi.ehsMaterial.service.impl; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import com.ruoyi.common.utils.SecurityUtils; import org.springframework.stereotype.Service; import org.springframework.beans.factory.annotation.Autowired; import com.ruoyi.common.utils.StringUtils; @@ -45,6 +46,10 @@ public class EhsMaterialServiceImpl extends ServiceImpl selectEhsMaterialList(EhsMaterial ehsMaterial) { + if(SecurityUtils.getLoginUser().getUser().getDept().getParentId()!=null && + SecurityUtils.getLoginUser().getUser().getDept().getParentId().longValue()!=0){ + ehsMaterial.setDeptId(SecurityUtils.getLoginUser().getUser().getDept().getParentId().longValue()); + } return ehsMaterialMapper.selectEhsMaterialList(ehsMaterial); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsMaterialDetail/domain/EhsMaterialDetail.java b/ruoyi-system/src/main/java/com/ruoyi/ehsMaterialDetail/domain/EhsMaterialDetail.java new file mode 100644 index 0000000..4dc9b4b --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsMaterialDetail/domain/EhsMaterialDetail.java @@ -0,0 +1,70 @@ +package com.ruoyi.ehsMaterialDetail.domain; + +import java.util.Date; + +import com.baomidou.mybatisplus.annotation.TableField; +import com.fasterxml.jackson.annotation.JsonFormat; +import com.baomidou.mybatisplus.annotation.IdType; +import com.baomidou.mybatisplus.annotation.TableId; +import com.baomidou.mybatisplus.annotation.TableName; +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.ToString; +import lombok.experimental.Accessors; +import com.ruoyi.common.annotation.Excel; +import com.ruoyi.common.core.domain.BaseEntity; + +/** + * 资源管理出库入库明细对象 ehs_material_detail + * + * @author ruoyi + * @date 2023-12-05 + */ +@Data +@ToString +@NoArgsConstructor +@Accessors(chain = true) +@TableName("ehs_material_detail") +public class EhsMaterialDetail extends BaseEntity +{ + private static final long serialVersionUID = 1L; + + /** 主键 */ + @TableId(type= IdType.AUTO) + private Long materialDetailId; + + /** 物资表 */ + @Excel(name = "物资表") + private Long materialId; + + /** 出库指令发送人 */ + @Excel(name = "出库指令发送人") + @TableField(exist = false) + private String sendUserName; + private Long sendUserId; + + /** 出库指令发送数量 */ + @Excel(name = "出库指令发送数量") + private String sendQuantity; + + /** 出库指令发送时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "出库指令发送时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date sendTime; + + /** 出库人 */ + @Excel(name = "出库人") + @TableField(exist = false) + private String outboundUserName; + private Long outboundUserId; + + /** 出库数量 */ + @Excel(name = "出库数量") + private String outboundQuantity; + + /** 出库时间 */ + @JsonFormat(pattern = "yyyy-MM-dd") + @Excel(name = "出库时间", width = 30, dateFormat = "yyyy-MM-dd") + private Date outboundTime; + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsMaterialDetail/mapper/EhsMaterialDetailMapper.java b/ruoyi-system/src/main/java/com/ruoyi/ehsMaterialDetail/mapper/EhsMaterialDetailMapper.java new file mode 100644 index 0000000..82f1cc6 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsMaterialDetail/mapper/EhsMaterialDetailMapper.java @@ -0,0 +1,37 @@ +package com.ruoyi.ehsMaterialDetail.mapper; + +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import com.ruoyi.ehsMaterialDetail.domain.EhsMaterialDetail; +import java.util.List; + +/** + * 资源管理出库入库明细Mapper接口 + * + * @author ruoyi + * @date 2023-12-05 + */ +public interface EhsMaterialDetailMapper extends BaseMapper { + /** + * 查询资源管理出库入库明细 + * + * @param materialDetailId 资源管理出库入库明细主键 + * @return 资源管理出库入库明细 + */ + public EhsMaterialDetail selectEhsMaterialDetailByMaterialDetailId(Long materialDetailId); + + /** + * 查询资源管理出库入库明细列表 + * + * @param ehsMaterialDetail 资源管理出库入库明细 + * @return 资源管理出库入库明细集合 + */ + public List selectEhsMaterialDetailList(EhsMaterialDetail ehsMaterialDetail); + + /** + * 按主表id删除未执行指令的记录 + * + * @param materialId 物资表ID + * @return 结果 + */ + public int deleteEhsMaterialDetailByMaterialId(Long materialId); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsMaterialDetail/service/IEhsMaterialDetailService.java b/ruoyi-system/src/main/java/com/ruoyi/ehsMaterialDetail/service/IEhsMaterialDetailService.java new file mode 100644 index 0000000..fe33bce --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsMaterialDetail/service/IEhsMaterialDetailService.java @@ -0,0 +1,37 @@ +package com.ruoyi.ehsMaterialDetail.service; + +import java.util.List; +import com.baomidou.mybatisplus.extension.service.IService; +import com.ruoyi.ehsMaterialDetail.domain.EhsMaterialDetail; + +/** + * 资源管理出库入库明细Service接口 + * + * @author ruoyi + * @date 2023-12-05 + */ +public interface IEhsMaterialDetailService extends IService { + + /** + * 查询资源管理出库入库明细 + * + * @param materialDetailId 资源管理出库入库明细主键 + * @return 资源管理出库入库明细 + */ + public EhsMaterialDetail selectEhsMaterialDetailByMaterialDetailId(Long materialDetailId); + + /** + * 查询资源管理出库入库明细列表 + * + * @param ehsMaterialDetail 资源管理出库入库明细 + * @return 资源管理出库入库明细集合 + */ + public List selectEhsMaterialDetailList(EhsMaterialDetail ehsMaterialDetail); + /** + * 按主表id删除未执行指令的记录 + * + * @param materialId 物资表ID + * @return 结果 + */ + public int deleteEhsMaterialDetailByMaterialId(Long materialId); +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsMaterialDetail/service/impl/EhsMaterialDetailServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/ehsMaterialDetail/service/impl/EhsMaterialDetailServiceImpl.java new file mode 100644 index 0000000..b2a0714 --- /dev/null +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsMaterialDetail/service/impl/EhsMaterialDetailServiceImpl.java @@ -0,0 +1,76 @@ +package com.ruoyi.ehsMaterialDetail.service.impl; + +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.toolkit.Wrappers; +import org.springframework.stereotype.Service; +import org.springframework.beans.factory.annotation.Autowired; +import com.ruoyi.common.utils.StringUtils; +import java.util.List; +import java.util.Map; +import com.ruoyi.ehsMaterialDetail.mapper.EhsMaterialDetailMapper; +import com.ruoyi.ehsMaterialDetail.domain.EhsMaterialDetail; +import com.ruoyi.ehsMaterialDetail.service.IEhsMaterialDetailService; + +/** + * 资源管理出库入库明细Service业务层处理 + * + * @author ruoyi + * @date 2023-12-05 + */ +@Service +public class EhsMaterialDetailServiceImpl extends ServiceImpl implements IEhsMaterialDetailService { + + @Autowired + private EhsMaterialDetailMapper ehsMaterialDetailMapper; + + /** + * 查询资源管理出库入库明细 + * + * @param materialDetailId 资源管理出库入库明细主键 + * @return 资源管理出库入库明细 + */ + @Override + public EhsMaterialDetail selectEhsMaterialDetailByMaterialDetailId(Long materialDetailId) + { + return ehsMaterialDetailMapper.selectEhsMaterialDetailByMaterialDetailId(materialDetailId); + } + + /** + * 查询资源管理出库入库明细列表 + * + * @param ehsMaterialDetail 资源管理出库入库明细 + * @return 资源管理出库入库明细 + */ + @Override + public List selectEhsMaterialDetailList(EhsMaterialDetail ehsMaterialDetail) + { + return ehsMaterialDetailMapper.selectEhsMaterialDetailList(ehsMaterialDetail); + } + /** + * 按主表id删除未执行指令的记录 + * + * @param materialId 物资表ID + * @return 结果 + */ + @Override + public int deleteEhsMaterialDetailByMaterialId(Long materialId){ + return ehsMaterialDetailMapper.deleteEhsMaterialDetailByMaterialId(materialId); + } + + private LambdaQueryWrapper buildQueryWrapper(EhsMaterialDetail query) { + Map params = query.getParams(); + LambdaQueryWrapper lqw = Wrappers.lambdaQuery(); + lqw.eq(query.getMaterialId() != null, EhsMaterialDetail::getMaterialId, query.getMaterialId()); + lqw.eq(query.getSendUserId() != null, EhsMaterialDetail::getSendUserId, query.getSendUserId()); + lqw.eq(StringUtils.isNotBlank(query.getSendQuantity()), EhsMaterialDetail::getSendQuantity, query.getSendQuantity()); + lqw.eq(query.getSendTime() != null, EhsMaterialDetail::getSendTime, query.getSendTime()); + lqw.eq(query.getOutboundUserId() != null, EhsMaterialDetail::getOutboundUserId, query.getOutboundUserId()); + lqw.eq(StringUtils.isNotBlank(query.getOutboundQuantity()), EhsMaterialDetail::getOutboundQuantity, query.getOutboundQuantity()); + lqw.eq(query.getOutboundTime() != null, EhsMaterialDetail::getOutboundTime, query.getOutboundTime()); + lqw.orderByDesc(EhsMaterialDetail::getCreateTime); + lqw.eq(query.getDeptId() != null, EhsMaterialDetail::getDeptId, query.getDeptId()); + return lqw; + } + +} diff --git a/ruoyi-system/src/main/java/com/ruoyi/ehsRisk/service/impl/EhsRiskServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/ehsRisk/service/impl/EhsRiskServiceImpl.java index 9b3e63d..50c8a0a 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/ehsRisk/service/impl/EhsRiskServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/ehsRisk/service/impl/EhsRiskServiceImpl.java @@ -47,7 +47,7 @@ public class EhsRiskServiceImpl extends ServiceImpl impl { if(SecurityUtils.getLoginUser().getUser().getDept().getParentId()!=null && SecurityUtils.getLoginUser().getUser().getDept().getParentId().longValue()!=0){ - ehsRisk.setDeptId(SecurityUtils.getLoginUser().getUser().getDept().getParentId().longValue()); + ehsRisk.setDeptId(SecurityUtils.getLoginUser().getUser().getDept().getDeptId().longValue()); } return ehsRiskMapper.selectEhsRiskList(ehsRisk); } diff --git a/ruoyi-system/src/main/resources/mapper/ehs/EhsMaterialDetailMapper.xml b/ruoyi-system/src/main/resources/mapper/ehs/EhsMaterialDetailMapper.xml new file mode 100644 index 0000000..1372dc1 --- /dev/null +++ b/ruoyi-system/src/main/resources/mapper/ehs/EhsMaterialDetailMapper.xml @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + select mt.*,u1.nick_name send_user_name,u2.nick_name outbound_user_Name + from ehs_material_detail mt left join sys_user u1 on mt.send_user_id=u1.user_id + left join sys_user u2 on mt.outbound_user_id=u2.user_id + + + + + + + + delete from ehs_material_detail where material_id = #{materialId} and outbound_user_id is null + + + + \ No newline at end of file diff --git a/ruoyi-system/src/main/resources/mapper/ehs/EhsMaterialMapper.xml b/ruoyi-system/src/main/resources/mapper/ehs/EhsMaterialMapper.xml index aa279ce..dc5562b 100644 --- a/ruoyi-system/src/main/resources/mapper/ehs/EhsMaterialMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/ehs/EhsMaterialMapper.xml @@ -15,6 +15,7 @@ + @@ -26,12 +27,18 @@ - select material_id, material_type, class_first, class_second, material_name, material_specs, material_quantity, reserve_location, Manager_person, tel, create_by, create_time, update_by, update_time, remark, dept_id, create_user_id, update_user_id from ehs_material + select m.* , d.dept_name,a.send_quantity from ehs_material m + left join sys_dept d on m.dept_id = d.dept_id + left join (select GROUP_CONCAT(send_quantity ) send_quantity,m.material_id + from ehs_material m left join ehs_material_detail dt + on dt.material_id= m.material_id and dt.outbound_user_id is null group by dt.material_id ) a + on a.material_id= m.material_id