Commit 25dfb6b3 authored by 耿迪迪's avatar 耿迪迪

生产执行

parent 89fbe881
...@@ -45,6 +45,13 @@ public class TProductDrawingController extends BaseController ...@@ -45,6 +45,13 @@ public class TProductDrawingController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
@GetMapping("/drawInfoList")
public AjaxResult drawInfoList(TProductDrawing tProductDrawing)
{
List<TProductDrawing> list = tProductDrawingService.selectTProductDrawingList(tProductDrawing);
return AjaxResult.success(list);
}
/** /**
* 导出图纸列表 * 导出图纸列表
*/ */
......
package com.zehong.web.controller.track;
import java.util.List;
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 com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.track.TProductInspect;
import com.zehong.system.service.track.ITProductInspectService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 生产执行Controller
*
* @author zehong
* @date 2024-08-26
*/
@RestController
@RequestMapping("/track/execute")
public class TProductInspectController extends BaseController
{
@Autowired
private ITProductInspectService tProductInspectService;
/**
* 查询生产执行列表
*/
// @PreAuthorize("@ss.hasPermi('system:inspect:list')")
@GetMapping("/list")
public TableDataInfo list(TProductInspect tProductInspect)
{
startPage();
List<TProductInspect> list = tProductInspectService.selectTProductInspectList(tProductInspect);
return getDataTable(list);
}
/**
* 导出生产执行列表
*/
//@PreAuthorize("@ss.hasPermi('system:inspect:export')")
@Log(title = "生产执行", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TProductInspect tProductInspect)
{
List<TProductInspect> list = tProductInspectService.selectTProductInspectList(tProductInspect);
ExcelUtil<TProductInspect> util = new ExcelUtil<TProductInspect>(TProductInspect.class);
return util.exportExcel(list, "生产执行数据");
}
/**
* 获取生产执行详细信息
*/
//@PreAuthorize("@ss.hasPermi('system:inspect:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(tProductInspectService.selectTProductInspectById(id));
}
/**
* 新增生产执行
*/
//@PreAuthorize("@ss.hasPermi('system:inspect:add')")
@Log(title = "生产执行", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TProductInspect tProductInspect)
{
return toAjax(tProductInspectService.insertTProductInspect(tProductInspect));
}
/**
* 修改生产执行
*/
//@PreAuthorize("@ss.hasPermi('system:inspect:edit')")
@Log(title = "生产执行", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TProductInspect tProductInspect)
{
return toAjax(tProductInspectService.updateTProductInspect(tProductInspect));
}
/**
* 删除生产执行
*/
//@PreAuthorize("@ss.hasPermi('system:inspect:remove')")
@Log(title = "生产执行", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tProductInspectService.deleteTProductInspectByIds(ids));
}
}
package com.zehong.web.controller.track;
import java.util.List;
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 com.zehong.common.annotation.Log;
import com.zehong.common.core.controller.BaseController;
import com.zehong.common.core.domain.AjaxResult;
import com.zehong.common.enums.BusinessType;
import com.zehong.system.domain.track.TProductInspectDetail;
import com.zehong.system.service.track.ITProductInspectDetailService;
import com.zehong.common.utils.poi.ExcelUtil;
import com.zehong.common.core.page.TableDataInfo;
/**
* 生产执行中间Controller
*
* @author zehong
* @date 2024-08-26
*/
@RestController
@RequestMapping("/track/executeDetail")
public class TProductInspectDetailController extends BaseController
{
@Autowired
private ITProductInspectDetailService tProductInspectDetailService;
/**
* 查询生产执行中间列表
*/
// @PreAuthorize("@ss.hasPermi('system:detail:list')")
@GetMapping("/list")
public TableDataInfo list(TProductInspectDetail tProductInspectDetail)
{
startPage();
List<TProductInspectDetail> list = tProductInspectDetailService.selectTProductInspectDetailList(tProductInspectDetail);
return getDataTable(list);
}
/**
* 导出生产执行中间列表
*/
//@PreAuthorize("@ss.hasPermi('system:detail:export')")
@Log(title = "生产执行中间", businessType = BusinessType.EXPORT)
@GetMapping("/export")
public AjaxResult export(TProductInspectDetail tProductInspectDetail)
{
List<TProductInspectDetail> list = tProductInspectDetailService.selectTProductInspectDetailList(tProductInspectDetail);
ExcelUtil<TProductInspectDetail> util = new ExcelUtil<TProductInspectDetail>(TProductInspectDetail.class);
return util.exportExcel(list, "生产执行中间数据");
}
/**
* 获取生产执行中间详细信息
*/
//@PreAuthorize("@ss.hasPermi('system:detail:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(tProductInspectDetailService.selectTProductInspectDetailById(id));
}
/**
* 新增生产执行中间
*/
//@PreAuthorize("@ss.hasPermi('system:detail:add')")
@Log(title = "生产执行中间", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody TProductInspectDetail tProductInspectDetail)
{
return toAjax(tProductInspectDetailService.insertTProductInspectDetail(tProductInspectDetail));
}
/**
* 修改生产执行中间
*/
//@PreAuthorize("@ss.hasPermi('system:detail:edit')")
@Log(title = "生产执行中间", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody TProductInspectDetail tProductInspectDetail)
{
return toAjax(tProductInspectDetailService.updateTProductInspectDetail(tProductInspectDetail));
}
/**
* 删除生产执行中间
*/
//@PreAuthorize("@ss.hasPermi('system:detail:remove')")
@Log(title = "生产执行中间", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(tProductInspectDetailService.deleteTProductInspectDetailByIds(ids));
}
@PostMapping("/batchAddDetailInfo")
public AjaxResult batchAddDetailInfo(@RequestBody List<TProductInspectDetail> productInspectDetailList) {
return toAjax(tProductInspectDetailService.batchAddDetailInfo(productInspectDetailList));
}
}
...@@ -45,6 +45,13 @@ public class TProductMarkController extends BaseController ...@@ -45,6 +45,13 @@ public class TProductMarkController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
@GetMapping("/markInfoList")
public AjaxResult markInfoList(TProductMark tProductMark)
{
List<TProductMark> list = tProductMarkService.selectTProductMarkList(tProductMark);
return AjaxResult.success(list);
}
/** /**
* 导出装配模板列表 * 导出装配模板列表
*/ */
......
...@@ -45,6 +45,13 @@ public class TProductPlanController extends BaseController ...@@ -45,6 +45,13 @@ public class TProductPlanController extends BaseController
return getDataTable(list); return getDataTable(list);
} }
@GetMapping("/planInfoList")
public AjaxResult planInfoList(TProductPlan tProductPlan)
{
List<TProductPlan> list = tProductPlanService.selectTProductPlanList(tProductPlan);
return AjaxResult.success(list);
}
/** /**
* 导出生产计划列表 * 导出生产计划列表
*/ */
......
package com.zehong.system.domain.track;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 生产执行对象 t_product_inspect
*
* @author zehong
* @date 2024-08-26
*/
public class TProductInspect extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 计划编号 */
private Long planId;
@Excel(name = "计划名称")
private String planName;
/** 批次号 */
@Excel(name = "批次号")
private String batchNo;
/** 生产数量 */
@Excel(name = "生产数量")
private Long total;
/** 开始时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date starttime;
/** 结束时间 */
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
@Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
private Date endtime;
/** 执行状态 */
@Excel(name = "执行状态",dictType = "t_produce_execute")
private String status;
/** 创建人 */
private Long createId;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setPlanId(Long planId)
{
this.planId = planId;
}
public Long getPlanId()
{
return planId;
}
public String getPlanName() {
return planName;
}
public void setPlanName(String planName) {
this.planName = planName;
}
public void setBatchNo(String batchNo)
{
this.batchNo = batchNo;
}
public String getBatchNo()
{
return batchNo;
}
public void setTotal(Long total)
{
this.total = total;
}
public Long getTotal()
{
return total;
}
public void setStarttime(Date starttime)
{
this.starttime = starttime;
}
public Date getStarttime()
{
return starttime;
}
public void setEndtime(Date endtime)
{
this.endtime = endtime;
}
public Date getEndtime()
{
return endtime;
}
public void setStatus(String status)
{
this.status = status;
}
public String getStatus()
{
return status;
}
public void setCreateId(Long createId)
{
this.createId = createId;
}
public Long getCreateId()
{
return createId;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("planId", getPlanId())
.append("batchNo", getBatchNo())
.append("total", getTotal())
.append("starttime", getStarttime())
.append("endtime", getEndtime())
.append("status", getStatus())
.append("createTime", getCreateTime())
.append("createId", getCreateId())
.toString();
}
}
package com.zehong.system.domain.track;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.zehong.common.annotation.Excel;
import com.zehong.common.core.domain.BaseEntity;
/**
* 生产执行中间对象 t_product_inspect_detail
*
* @author zehong
* @date 2024-08-26
*/
public class TProductInspectDetail extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** $column.columnComment */
private Long id;
/** 执行编号 */
private Long inspectId;
@Excel(name="批次号")
private String batchNo;
/** 关联类型,1是图纸,2是配件,3是装配模板 */
@Excel(name = "关联类型",readConverterExp="1=图纸,2=配件,3=装配模版")
private Integer type;
/** 关联类型对应的编号 */
private Long typeId;
@Excel(name = "名称")
private String typeName;
/** 配件数量 */
@Excel(name = "配件数量")
private Long number;
/** $column.columnComment */
private Long createId;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setInspectId(Long inspectId)
{
this.inspectId = inspectId;
}
public Long getInspectId()
{
return inspectId;
}
public void setType(Integer type)
{
this.type = type;
}
public Integer getType()
{
return type;
}
public void setTypeId(Long typeId)
{
this.typeId = typeId;
}
public Long getTypeId()
{
return typeId;
}
public void setNumber(Long number)
{
this.number = number;
}
public Long getNumber()
{
return number;
}
public void setCreateId(Long createId)
{
this.createId = createId;
}
public Long getCreateId()
{
return createId;
}
public String getBatchNo() {
return batchNo;
}
public void setBatchNo(String batchNo) {
this.batchNo = batchNo;
}
public String getTypeName() {
return typeName;
}
public void setTypeName(String typeName) {
this.typeName = typeName;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("inspectId", getInspectId())
.append("type", getType())
.append("typeId", getTypeId())
.append("number", getNumber())
.append("createTime", getCreateTime())
.append("createId", getCreateId())
.toString();
}
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.track.TProductInspectDetail;
/**
* 生产执行中间Mapper接口
*
* @author zehong
* @date 2024-08-26
*/
public interface TProductInspectDetailMapper
{
/**
* 查询生产执行中间
*
* @param id 生产执行中间ID
* @return 生产执行中间
*/
public TProductInspectDetail selectTProductInspectDetailById(Long id);
/**
* 查询生产执行中间列表
*
* @param tProductInspectDetail 生产执行中间
* @return 生产执行中间集合
*/
public List<TProductInspectDetail> selectTProductInspectDetailList(TProductInspectDetail tProductInspectDetail);
/**
* 新增生产执行中间
*
* @param tProductInspectDetail 生产执行中间
* @return 结果
*/
public int insertTProductInspectDetail(TProductInspectDetail tProductInspectDetail);
/**
* 修改生产执行中间
*
* @param tProductInspectDetail 生产执行中间
* @return 结果
*/
public int updateTProductInspectDetail(TProductInspectDetail tProductInspectDetail);
/**
* 删除生产执行中间
*
* @param id 生产执行中间ID
* @return 结果
*/
public int deleteTProductInspectDetailById(Long id);
/**
* 批量删除生产执行中间
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteTProductInspectDetailByIds(Long[] ids);
/**
* 批量新增
* @param productInspectDetailList
* @return
*/
int batchAddDetailInfo(List<TProductInspectDetail> productInspectDetailList);
}
package com.zehong.system.mapper;
import java.util.List;
import com.zehong.system.domain.track.TProductInspect;
/**
* 生产执行Mapper接口
*
* @author zehong
* @date 2024-08-26
*/
public interface TProductInspectMapper
{
/**
* 查询生产执行
*
* @param id 生产执行ID
* @return 生产执行
*/
public TProductInspect selectTProductInspectById(Long id);
/**
* 查询生产执行列表
*
* @param tProductInspect 生产执行
* @return 生产执行集合
*/
public List<TProductInspect> selectTProductInspectList(TProductInspect tProductInspect);
/**
* 新增生产执行
*
* @param tProductInspect 生产执行
* @return 结果
*/
public int insertTProductInspect(TProductInspect tProductInspect);
/**
* 修改生产执行
*
* @param tProductInspect 生产执行
* @return 结果
*/
public int updateTProductInspect(TProductInspect tProductInspect);
/**
* 删除生产执行
*
* @param id 生产执行ID
* @return 结果
*/
public int deleteTProductInspectById(Long id);
/**
* 批量删除生产执行
*
* @param ids 需要删除的数据ID
* @return 结果
*/
public int deleteTProductInspectByIds(Long[] ids);
}
package com.zehong.system.service.impl.track;
import java.util.Date;
import java.util.List;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TProductInspectDetailMapper;
import com.zehong.system.domain.track.TProductInspectDetail;
import com.zehong.system.service.track.ITProductInspectDetailService;
/**
* 生产执行中间Service业务层处理
*
* @author zehong
* @date 2024-08-26
*/
@Service
public class TProductInspectDetailServiceImpl implements ITProductInspectDetailService
{
@Autowired
private TProductInspectDetailMapper tProductInspectDetailMapper;
/**
* 查询生产执行中间
*
* @param id 生产执行中间ID
* @return 生产执行中间
*/
@Override
public TProductInspectDetail selectTProductInspectDetailById(Long id)
{
return tProductInspectDetailMapper.selectTProductInspectDetailById(id);
}
/**
* 查询生产执行中间列表
*
* @param tProductInspectDetail 生产执行中间
* @return 生产执行中间
*/
@Override
public List<TProductInspectDetail> selectTProductInspectDetailList(TProductInspectDetail tProductInspectDetail)
{
return tProductInspectDetailMapper.selectTProductInspectDetailList(tProductInspectDetail);
}
/**
* 新增生产执行中间
*
* @param tProductInspectDetail 生产执行中间
* @return 结果
*/
@Override
public int insertTProductInspectDetail(TProductInspectDetail tProductInspectDetail)
{
tProductInspectDetail.setCreateTime(DateUtils.getNowDate());
tProductInspectDetail.setCreateId(SecurityUtils.getLoginUser().getUser().getUserId());
return tProductInspectDetailMapper.insertTProductInspectDetail(tProductInspectDetail);
}
/**
* 修改生产执行中间
*
* @param tProductInspectDetail 生产执行中间
* @return 结果
*/
@Override
public int updateTProductInspectDetail(TProductInspectDetail tProductInspectDetail)
{
return tProductInspectDetailMapper.updateTProductInspectDetail(tProductInspectDetail);
}
/**
* 批量删除生产执行中间
*
* @param ids 需要删除的生产执行中间ID
* @return 结果
*/
@Override
public int deleteTProductInspectDetailByIds(Long[] ids)
{
return tProductInspectDetailMapper.deleteTProductInspectDetailByIds(ids);
}
/**
* 删除生产执行中间信息
*
* @param id 生产执行中间ID
* @return 结果
*/
@Override
public int deleteTProductInspectDetailById(Long id)
{
return tProductInspectDetailMapper.deleteTProductInspectDetailById(id);
}
/**
* 批量新增详情
* @param productInspectDetailList
* @return
*/
public int batchAddDetailInfo(List<TProductInspectDetail> productInspectDetailList){
for(TProductInspectDetail detail : productInspectDetailList){
detail.setCreateTime(new Date());
detail.setCreateId(SecurityUtils.getLoginUser().getUser().getUserId());
}
return tProductInspectDetailMapper.batchAddDetailInfo(productInspectDetailList);
}
}
package com.zehong.system.service.impl.track;
import java.sql.SQLIntegrityConstraintViolationException;
import java.util.List;
import com.zehong.common.exception.CustomException;
import com.zehong.common.utils.DateUtils;
import com.zehong.common.utils.SecurityUtils;
import com.zehong.common.utils.StringUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.zehong.system.mapper.TProductInspectMapper;
import com.zehong.system.domain.track.TProductInspect;
import com.zehong.system.service.track.ITProductInspectService;
/**
* 生产执行Service业务层处理
*
* @author zehong
* @date 2024-08-26
*/
@Service
public class TProductInspectServiceImpl implements ITProductInspectService
{
@Autowired
private TProductInspectMapper tProductInspectMapper;
/**
* 查询生产执行
*
* @param id 生产执行ID
* @return 生产执行
*/
@Override
public TProductInspect selectTProductInspectById(Long id)
{
return tProductInspectMapper.selectTProductInspectById(id);
}
/**
* 查询生产执行列表
*
* @param tProductInspect 生产执行
* @return 生产执行
*/
@Override
public List<TProductInspect> selectTProductInspectList(TProductInspect tProductInspect)
{
return tProductInspectMapper.selectTProductInspectList(tProductInspect);
}
/**
* 新增生产执行
*
* @param tProductInspect 生产执行
* @return 结果
*/
@Override
public int insertTProductInspect(TProductInspect tProductInspect)
{
try{
tProductInspect.setCreateTime(DateUtils.getNowDate());
tProductInspect.setCreateId(SecurityUtils.getLoginUser().getUser().getUserId());
return tProductInspectMapper.insertTProductInspect(tProductInspect);
}catch (Exception e){
Throwable cause = e.getCause();
if (cause instanceof SQLIntegrityConstraintViolationException){
String errMsg = cause.getMessage();
if (StringUtils.isNotEmpty(errMsg) && errMsg.contains("index_unique_batch_no")){
throw new CustomException("批次号不能重复");
}
}
throw e;
}
}
/**
* 修改生产执行
*
* @param tProductInspect 生产执行
* @return 结果
*/
@Override
public int updateTProductInspect(TProductInspect tProductInspect)
{
return tProductInspectMapper.updateTProductInspect(tProductInspect);
}
/**
* 批量删除生产执行
*
* @param ids 需要删除的生产执行ID
* @return 结果
*/
@Override
public int deleteTProductInspectByIds(Long[] ids)
{
return tProductInspectMapper.deleteTProductInspectByIds(ids);
}
/**
* 删除生产执行信息
*
* @param id 生产执行ID
* @return 结果
*/
@Override
public int deleteTProductInspectById(Long id)
{
return tProductInspectMapper.deleteTProductInspectById(id);
}
}
package com.zehong.system.service.track;
import java.util.List;
import com.zehong.system.domain.track.TProductInspectDetail;
/**
* 生产执行中间Service接口
*
* @author zehong
* @date 2024-08-26
*/
public interface ITProductInspectDetailService
{
/**
* 查询生产执行中间
*
* @param id 生产执行中间ID
* @return 生产执行中间
*/
public TProductInspectDetail selectTProductInspectDetailById(Long id);
/**
* 查询生产执行中间列表
*
* @param tProductInspectDetail 生产执行中间
* @return 生产执行中间集合
*/
public List<TProductInspectDetail> selectTProductInspectDetailList(TProductInspectDetail tProductInspectDetail);
/**
* 新增生产执行中间
*
* @param tProductInspectDetail 生产执行中间
* @return 结果
*/
public int insertTProductInspectDetail(TProductInspectDetail tProductInspectDetail);
/**
* 修改生产执行中间
*
* @param tProductInspectDetail 生产执行中间
* @return 结果
*/
public int updateTProductInspectDetail(TProductInspectDetail tProductInspectDetail);
/**
* 批量删除生产执行中间
*
* @param ids 需要删除的生产执行中间ID
* @return 结果
*/
public int deleteTProductInspectDetailByIds(Long[] ids);
/**
* 删除生产执行中间信息
*
* @param id 生产执行中间ID
* @return 结果
*/
public int deleteTProductInspectDetailById(Long id);
/**
* 批量新增详情
* @param productInspectDetailList
* @return
*/
int batchAddDetailInfo(List<TProductInspectDetail> productInspectDetailList);
}
package com.zehong.system.service.track;
import java.util.List;
import com.zehong.system.domain.track.TProductInspect;
/**
* 生产执行Service接口
*
* @author zehong
* @date 2024-08-26
*/
public interface ITProductInspectService
{
/**
* 查询生产执行
*
* @param id 生产执行ID
* @return 生产执行
*/
public TProductInspect selectTProductInspectById(Long id);
/**
* 查询生产执行列表
*
* @param tProductInspect 生产执行
* @return 生产执行集合
*/
public List<TProductInspect> selectTProductInspectList(TProductInspect tProductInspect);
/**
* 新增生产执行
*
* @param tProductInspect 生产执行
* @return 结果
*/
public int insertTProductInspect(TProductInspect tProductInspect);
/**
* 修改生产执行
*
* @param tProductInspect 生产执行
* @return 结果
*/
public int updateTProductInspect(TProductInspect tProductInspect);
/**
* 批量删除生产执行
*
* @param ids 需要删除的生产执行ID
* @return 结果
*/
public int deleteTProductInspectByIds(Long[] ids);
/**
* 删除生产执行信息
*
* @param id 生产执行ID
* @return 结果
*/
public int deleteTProductInspectById(Long id);
}
<?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.zehong.system.mapper.TProductInspectDetailMapper">
<resultMap type="TProductInspectDetail" id="TProductInspectDetailResult">
<result property="id" column="id" />
<result property="inspectId" column="inspect_id" />
<result property="type" column="type" />
<result property="typeId" column="type_id" />
<result property="number" column="number" />
<result property="createTime" column="create_time" />
<result property="createId" column="create_id" />
</resultMap>
<sql id="selectTProductInspectDetailVo">
SELECT
id,
inspect_id,
(SELECT batch_no FROM t_product_inspect WHERE id = inspect_id)as batchNo,
`type`,
type_id,
`number`,
create_time,
create_id,
(
CASE
WHEN type = '1' THEN (select title from t_product_drawing draw WHERE draw.id = type_id)
WHEN type = '2' THEN (select title from t_product_store store WHERE store.id = type_id)
WHEN type = '3' THEN (select title from t_product_mark mark WHERE mark.id = type_id)
END
)as typeName,
<include refid="Common.createBy"/>
FROM
t_product_inspect_detail
</sql>
<select id="selectTProductInspectDetailList" parameterType="TProductInspectDetail" resultMap="TProductInspectDetailResult">
<include refid="selectTProductInspectDetailVo"/>
<where>
<if test="inspectId != null "> and inspect_id = #{inspectId}</if>
<if test="type != null "> and type = #{type}</if>
<if test="typeId != null "> and type_id = #{typeId}</if>
</where>
</select>
<select id="selectTProductInspectDetailById" parameterType="Long" resultMap="TProductInspectDetailResult">
<include refid="selectTProductInspectDetailVo"/>
where id = #{id}
</select>
<insert id="insertTProductInspectDetail" parameterType="TProductInspectDetail" useGeneratedKeys="true" keyProperty="id">
insert into t_product_inspect_detail
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="inspectId != null">inspect_id,</if>
<if test="type != null">`type`,</if>
<if test="typeId != null">type_id,</if>
<if test="number != null">`number`,</if>
<if test="createTime != null">create_time,</if>
<if test="createId != null">create_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="inspectId != null">#{inspectId},</if>
<if test="type != null">#{type},</if>
<if test="typeId != null">#{typeId},</if>
<if test="number != null">#{number},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createId != null">#{createId},</if>
</trim>
</insert>
<update id="updateTProductInspectDetail" parameterType="TProductInspectDetail">
update t_product_inspect_detail
<trim prefix="SET" suffixOverrides=",">
<if test="inspectId != null">inspect_id = #{inspectId},</if>
<if test="type != null">`type` = #{type},</if>
<if test="typeId != null">type_id = #{typeId},</if>
<if test="number != null">`number` = #{number},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createId != null">create_id = #{createId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTProductInspectDetailById" parameterType="Long">
delete from t_product_inspect_detail where id = #{id}
</delete>
<delete id="deleteTProductInspectDetailByIds" parameterType="String">
delete from t_product_inspect_detail where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
<insert id="batchAddDetailInfo" parameterType="List" useGeneratedKeys="true" keyProperty="id">
insert into t_product_inspect_detail(
inspect_id,`type`,type_id,`number`,create_time,create_id
)values
<foreach item="item" collection="list" index="index" separator=",">
(#{item.inspectId},#{item.type},#{item.typeId},#{item.number},#{item.createTime},#{item.createId})
</foreach>
</insert>
</mapper>
\ No newline at end of file
<?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.zehong.system.mapper.TProductInspectMapper">
<resultMap type="TProductInspect" id="TProductInspectResult">
<result property="id" column="id" />
<result property="planId" column="plan_id" />
<result property="batchNo" column="batch_no" />
<result property="total" column="total" />
<result property="starttime" column="starttime" />
<result property="endtime" column="endtime" />
<result property="status" column="status" />
<result property="createTime" column="create_time" />
<result property="createId" column="create_id" />
</resultMap>
<sql id="selectTProductInspectVo">
SELECT
ins.id,
ins.plan_id,
plan.title as planName,
ins.batch_no,
ins.total,
ins.starttime,
ins.endtime,
ins.`STATUS`,
ins.create_time,
ins.create_id,
(select nick_name from sys_user where user_id = ins.create_id) as createBy
FROM
t_product_inspect ins
LEFT JOIN t_product_plan plan ON plan.id = ins.plan_id
</sql>
<select id="selectTProductInspectList" parameterType="TProductInspect" resultMap="TProductInspectResult">
<include refid="selectTProductInspectVo"/>
<where>
<if test="batchNo != null and batchNo != ''"> and ins.batch_no = #{batchNo}</if>
<if test="status != null and status != ''"> and ins.status = #{status}</if>
</where>
order by ins.create_time desc
</select>
<select id="selectTProductInspectById" parameterType="Long" resultMap="TProductInspectResult">
<include refid="selectTProductInspectVo"/>
where ins.id = #{id}
</select>
<insert id="insertTProductInspect" parameterType="TProductInspect" useGeneratedKeys="true" keyProperty="id">
insert into t_product_inspect
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="planId != null">plan_id,</if>
<if test="batchNo != null and batchNo != ''">batch_no,</if>
<if test="total != null">total,</if>
<if test="starttime != null">starttime,</if>
<if test="endtime != null">endtime,</if>
<if test="status != null">status,</if>
<if test="createTime != null">create_time,</if>
<if test="createId != null">create_id,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="planId != null">#{planId},</if>
<if test="batchNo != null and batchNo != ''">#{batchNo},</if>
<if test="total != null">#{total},</if>
<if test="starttime != null">#{starttime},</if>
<if test="endtime != null">#{endtime},</if>
<if test="status != null">#{status},</if>
<if test="createTime != null">#{createTime},</if>
<if test="createId != null">#{createId},</if>
</trim>
</insert>
<update id="updateTProductInspect" parameterType="TProductInspect">
update t_product_inspect
<trim prefix="SET" suffixOverrides=",">
<if test="planId != null">plan_id = #{planId},</if>
<if test="batchNo != null and batchNo != ''">batch_no = #{batchNo},</if>
<if test="total != null">total = #{total},</if>
<if test="starttime != null">starttime = #{starttime},</if>
<if test="endtime != null">endtime = #{endtime},</if>
<if test="status != null">status = #{status},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="createId != null">create_id = #{createId},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteTProductInspectById" parameterType="Long">
delete from t_product_inspect where id = #{id}
</delete>
<delete id="deleteTProductInspectByIds" parameterType="String">
delete from t_product_inspect where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
\ No newline at end of file
...@@ -51,3 +51,12 @@ export function exportDrawing(query) { ...@@ -51,3 +51,12 @@ export function exportDrawing(query) {
params: query params: query
}) })
} }
// 查询图纸全部信息
export function drawInfoList(query) {
return request({
url: '/track/drawing/drawInfoList',
method: 'get',
params: query
})
}
import request from '@/utils/request'
// 查询生产执行列表
export function listInspect(query) {
return request({
url: '/track/execute/list',
method: 'get',
params: query
})
}
// 查询生产执行详细
export function getInspect(id) {
return request({
url: '/track/execute/' + id,
method: 'get'
})
}
// 新增生产执行
export function addInspect(data) {
return request({
url: '/track/execute',
method: 'post',
data: data
})
}
// 修改生产执行
export function updateInspect(data) {
return request({
url: '/track/execute',
method: 'put',
data: data
})
}
// 删除生产执行
export function delInspect(id) {
return request({
url: '/track/execute/' + id,
method: 'delete'
})
}
// 导出生产执行
export function exportInspect(query) {
return request({
url: '/track/execute/export',
method: 'get',
params: query
})
}
import request from '@/utils/request'
// 查询生产执行中间列表
export function listDetail(query) {
return request({
url: '/track/executeDetail/list',
method: 'get',
params: query
})
}
// 查询生产执行中间详细
export function getDetail(id) {
return request({
url: '/track/executeDetail/' + id,
method: 'get'
})
}
// 新增生产执行中间
export function addDetail(data) {
return request({
url: '/track/executeDetail',
method: 'post',
data: data
})
}
// 修改生产执行中间
export function updateDetail(data) {
return request({
url: '/track/executeDetail',
method: 'put',
data: data
})
}
// 删除生产执行中间
export function delDetail(id) {
return request({
url: '/track/executeDetail/' + id,
method: 'delete'
})
}
// 导出生产执行中间
export function exportDetail(query) {
return request({
url: '/track/executeDetail/export',
method: 'get',
params: query
})
}
//批量新增
export function batchAddDetailInfo(data) {
return request({
url: '/track/executeDetail/batchAddDetailInfo',
method: 'post',
data: data
})
}
...@@ -51,3 +51,12 @@ export function exportMark(query) { ...@@ -51,3 +51,12 @@ export function exportMark(query) {
params: query params: query
}) })
} }
//查看全部模版信息
export function markInfoList(query) {
return request({
url: '/track/mark/markInfoList',
method: 'get',
params: query
})
}
...@@ -51,3 +51,12 @@ export function exportPlan(query) { ...@@ -51,3 +51,12 @@ export function exportPlan(query) {
params: query params: query
}) })
} }
//生产计划所有信息
export function planInfoList(query) {
return request({
url: '/track/plan/planInfoList',
method: 'get',
params: query
})
}
<template>
<!-- 入库 -->
<el-dialog title="新增生产执行详情" :visible.sync="executeDetailOpen" width="800px" append-to-body destroy-on-close :close-on-click-modal="false">
<div class="execute-detail-form">
<div class="execute-detail-item" v-for="(item,index) in detailInfoList">
<div class="execute-detail-info">
<el-select v-model="item.type" placeholder="请选择关联类型" size="small">
<el-option label="图纸" value="1" />
<el-option label="配件" value="2" />
<el-option label="装配模板" value="3" />
</el-select>
</div>
<div class="execute-detail-info">
<el-select v-model="item.typeId" v-if="item.type == '1'" placeholder="请选择图纸" clearable size="small" @change="pictureChange($event,index)">
<el-option
v-for="picture in pictureList"
:key="picture.id"
:label="picture.title"
:value="picture.id"
/>
</el-select>
<el-select v-model="item.typeId" v-if="item.type == '2'" placeholder="请选择配件" clearable size="small" @change="storeChange($event,index)">
<el-option
v-for="store in storeInfoList"
:key="store.id"
:label="store.title"
:value="store.id"
/>
</el-select>
<el-select v-model="item.typeId" v-if="item.type == '3'" placeholder="请选择转配模版" clearable size="small" @change="markChange($event,index)">
<el-option
v-for="mark in markList"
:key="mark.id"
:label="mark.title"
:value="mark.id"
/>
</el-select>
</div>
<div class="execute-detail-info">
<el-input type="number" v-model.number="item.number" placeholder="请输入数量" size="small"/>
</div>
<div class="execute-detail-operate">
<i style="color:#1890ff" class="el-icon-circle-plus-outline" v-if="detailInfoList.length -1 == index" @click="addDetail"></i>
<i style="color: #ff9292" class="el-icon-remove-outline" v-else @click="delDetail(index)"></i>
</div>
</div>
</div>
<div slot="footer" class="dialog-footer">
<el-button type="primary" @click="submitStore">确 定</el-button>
<el-button @click="cancel">取 消</el-button>
</div>
</el-dialog>
</template>
<script>
import { drawInfoList } from "@/api/track/drawing";
import { getStores } from "@/api/track/store";
import { markInfoList } from "@/api/track/mark";
import { batchAddDetailInfo } from "@/api/track/executeDetail";
export default {
name: "add-detail",
props:{
executeId:{
type: Number
}
},
data(){
return{
executeDetailOpen: false,
storeList: [],
detailInfoList: [{type: '1',inspectId: this.executeId}],
pictureList: [],
storeInfoList: [],
markList: []
}
},
methods:{
openExecuteDetail(){
this.initInExecuteDetail();
this.getPictureInfo();
this.getStoreInfo();
this.getMarkInfo();
this.executeDetailOpen = true;
},
addDetail(){
this.detailInfoList.push({type: '1',inspectId: this.executeId});
},
delDetail(index){
this.detailInfoList.splice(index, 1);
},
getPictureInfo(){
drawInfoList().then(res =>{
if(res.code == 200){
this.pictureList = res.data;
}
})
},
getStoreInfo(){
getStores().then(res =>{
if(res.code == 200){
this.storeInfoList = res.data;
}
})
},
getMarkInfo(){
markInfoList().then(res =>{
if(res.code == 200){
this.markList = res.data;
}
})
},
pictureChange(val,index){
const store = this.detailInfoList.filter(item => item.id == val && item.type == '1');
if(store.length > 1){
this.detailInfoList[index].id = "";
this.$message.error("此图纸已被选中")
}
},
storeChange(val,index){
const store = this.detailInfoList.filter(item => item.id == val && item.type == '2');
if(store.length > 1){
this.detailInfoList[index].id = "";
this.$message.error("此配件已被选中")
}
},
markChange(val,index){
const store = this.detailInfoList.filter(item => item.id == val && item.type == '3');
if(store.length > 1){
this.detailInfoList[index].id = "";
this.$message.error("此装配模版已被选中")
}
},
submitStore(){
this.validateData();
batchAddDetailInfo(this.detailInfoList).then(res =>{
if(res.code == 200){
this.executeDetailOpen = false;
this.$parent.getList();
}
})
},
validateData(){
//检查信息是否完整
for(var i = 0; i< this.detailInfoList.length; i++){
if(!(this.detailInfoList[i].typeId && this.detailInfoList[i].number && this.detailInfoList[i].type)){
this.$message.error("请检查信息是否填完整");
return
}
}
if(this.detailInfoList.findIndex(item => item.type == '1') == -1){
this.$message.error("未选择图纸");
return
}
if(this.detailInfoList.findIndex(item => item.type == '2') == -1){
this.$message.error("未选择配件");
return
}
if(this.detailInfoList.findIndex(item => item.type == '3') == -1){
this.$message.error("未选择装配模版");
return
}
},
cancel(){
this.executeDetailOpen = false;
this.initInExecuteDetail();
},
initInExecuteDetail(){
this.detailInfoList = [{type: '1',inspectId: this.executeId}];
}
}
}
</script>
<style scoped lang="scss">
.execute-detail-form{
height: 350px;
overflow-y: scroll;
&::-webkit-scrollbar {
/* 设置滚动条宽度 */
width: 4px;
/* 设置滚动条背景色 */
//background: black;
}
//滚动条轨道
&::-webkit-scrollbar-track {
background-color:transparent;
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
border-radius:2em;
}
//滚动条滑块
&::-webkit-scrollbar-thumb {
background-color: rgb(147,147,153,0.5);
-webkit-border-radius: 2em;
-moz-border-radius: 2em;
border-radius:2em;
}
}
.execute-detail-item{
display: flex;
margin: 4px auto;
}
.execute-detail-info{
flex: 2;
}
.execute-detail-operate{
flex: 0.2;
text-align: center;
margin: auto
}
</style>
This diff is collapsed.
...@@ -73,19 +73,19 @@ ...@@ -73,19 +73,19 @@
} }
}, },
submitStore(){ submitStore(){
console.log("gege=======",this.inHouseStore) for(var i = 0; i< this.detailInfoList.length; i++){
this.inHouseStore.forEach(item =>{ if(!(this.detailInfoList[i].id && this.detailInfoList[i].num)){
if(!(item.id && item.num)){
this.$message.error("请检查信息是否填完整"); this.$message.error("请检查信息是否填完整");
return return
} }
}
inHouse(this.inHouseStore).then(res =>{ inHouse(this.inHouseStore).then(res =>{
if(res.code == 200){ if(res.code == 200){
this.houseOpen = false; this.houseOpen = false;
this.$parent.getList(); this.$parent.getList();
} }
}) })
})
}, },
cancel(){ cancel(){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment