parent
eba8e3c1a7
commit
81f9aa8f23
@ -0,0 +1,105 @@
|
||||
package com.hw.mes.controller;
|
||||
|
||||
import java.util.List;
|
||||
import java.io.IOException;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
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.hw.common.log.annotation.Log;
|
||||
import com.hw.common.log.enums.BusinessType;
|
||||
import com.hw.common.security.annotation.RequiresPermissions;
|
||||
import com.hw.mes.domain.MesProductPlan;
|
||||
import com.hw.mes.service.IMesProductPlanService;
|
||||
import com.hw.common.core.web.controller.BaseController;
|
||||
import com.hw.common.core.web.domain.AjaxResult;
|
||||
import com.hw.common.core.utils.poi.ExcelUtil;
|
||||
import com.hw.common.core.web.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 生产派工Controller
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-02-21
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/productplan")
|
||||
public class MesProductPlanController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IMesProductPlanService mesProductPlanService;
|
||||
|
||||
/**
|
||||
* 查询生产派工列表
|
||||
*/
|
||||
@RequiresPermissions("mes:productplan:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MesProductPlan mesProductPlan)
|
||||
{
|
||||
startPage();
|
||||
List<MesProductPlan> list = mesProductPlanService.selectMesProductPlanList(mesProductPlan);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出生产派工列表
|
||||
*/
|
||||
@RequiresPermissions("mes:productplan:export")
|
||||
@Log(title = "生产派工", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MesProductPlan mesProductPlan)
|
||||
{
|
||||
List<MesProductPlan> list = mesProductPlanService.selectMesProductPlanList(mesProductPlan);
|
||||
ExcelUtil<MesProductPlan> util = new ExcelUtil<MesProductPlan>(MesProductPlan.class);
|
||||
util.exportExcel(response, list, "生产派工数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取生产派工详细信息
|
||||
*/
|
||||
@RequiresPermissions("mes:productplan:query")
|
||||
@GetMapping(value = "/{planId}")
|
||||
public AjaxResult getInfo(@PathVariable("planId") Long planId)
|
||||
{
|
||||
return success(mesProductPlanService.selectMesProductPlanByPlanId(planId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产派工
|
||||
*/
|
||||
@RequiresPermissions("mes:productplan:add")
|
||||
@Log(title = "生产派工", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MesProductPlan mesProductPlan)
|
||||
{
|
||||
return toAjax(mesProductPlanService.insertMesProductPlan(mesProductPlan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产派工
|
||||
*/
|
||||
@RequiresPermissions("mes:productplan:edit")
|
||||
@Log(title = "生产派工", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MesProductPlan mesProductPlan)
|
||||
{
|
||||
return toAjax(mesProductPlanService.updateMesProductPlan(mesProductPlan));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产派工
|
||||
*/
|
||||
@RequiresPermissions("mes:productplan:remove")
|
||||
@Log(title = "生产派工", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{planIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] planIds)
|
||||
{
|
||||
return toAjax(mesProductPlanService.deleteMesProductPlanByPlanIds(planIds));
|
||||
}
|
||||
}
|
@ -0,0 +1,34 @@
|
||||
package com.hw.mes.domain.vo;
|
||||
|
||||
import lombok.Data;
|
||||
|
||||
import javax.validation.constraints.NotBlank;
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
/**
|
||||
* @Description:生产计划明细VO对象
|
||||
* @ProjectName:HwMes
|
||||
* @Author:xins
|
||||
* @Date:2024-02-22 9:41
|
||||
* @Version:1.0
|
||||
*/
|
||||
@Data
|
||||
public class MesProductPlanDetailVo {
|
||||
|
||||
//生产计划ID
|
||||
@NotNull(message = "生产计划ID必须输入")
|
||||
private Long planId;
|
||||
|
||||
//成品批次
|
||||
@NotNull(message = "物料ID必须输入")
|
||||
private Long materialId;
|
||||
|
||||
//成品批次
|
||||
@NotNull(message = "物料BomID必须输入")
|
||||
private Long materialBomId;
|
||||
|
||||
//成品批次
|
||||
@NotBlank(message = "计划数量必须输入")
|
||||
private String planAmount;
|
||||
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.hw.mes.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.hw.mes.domain.MesMaterialCheckResult;
|
||||
|
||||
/**
|
||||
* 生产计划校验记录Mapper接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-02-21
|
||||
*/
|
||||
public interface MesMaterialCheckResultMapper
|
||||
{
|
||||
/**
|
||||
* 查询生产计划校验记录
|
||||
*
|
||||
* @param materialCheckResultId 生产计划校验记录主键
|
||||
* @return 生产计划校验记录
|
||||
*/
|
||||
public MesMaterialCheckResult selectMesMaterialCheckResultByMaterialCheckResultId(Long materialCheckResultId);
|
||||
|
||||
/**
|
||||
* 查询生产计划校验记录列表
|
||||
*
|
||||
* @param mesMaterialCheckResult 生产计划校验记录
|
||||
* @return 生产计划校验记录集合
|
||||
*/
|
||||
public List<MesMaterialCheckResult> selectMesMaterialCheckResultList(MesMaterialCheckResult mesMaterialCheckResult);
|
||||
|
||||
/**
|
||||
* 新增生产计划校验记录
|
||||
*
|
||||
* @param mesMaterialCheckResult 生产计划校验记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesMaterialCheckResult(MesMaterialCheckResult mesMaterialCheckResult);
|
||||
|
||||
/**
|
||||
* 修改生产计划校验记录
|
||||
*
|
||||
* @param mesMaterialCheckResult 生产计划校验记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesMaterialCheckResult(MesMaterialCheckResult mesMaterialCheckResult);
|
||||
|
||||
/**
|
||||
* 删除生产计划校验记录
|
||||
*
|
||||
* @param materialCheckResultId 生产计划校验记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesMaterialCheckResultByMaterialCheckResultId(Long materialCheckResultId);
|
||||
|
||||
/**
|
||||
* 批量删除生产计划校验记录
|
||||
*
|
||||
* @param materialCheckResultIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesMaterialCheckResultByMaterialCheckResultIds(Long[] materialCheckResultIds);
|
||||
}
|
@ -0,0 +1,61 @@
|
||||
package com.hw.mes.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.hw.mes.domain.MesProductPlanDetail;
|
||||
|
||||
/**
|
||||
* 生产计划明细Mapper接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-02-21
|
||||
*/
|
||||
public interface MesProductPlanDetailMapper
|
||||
{
|
||||
/**
|
||||
* 查询生产计划明细
|
||||
*
|
||||
* @param planDetailId 生产计划明细主键
|
||||
* @return 生产计划明细
|
||||
*/
|
||||
public MesProductPlanDetail selectMesProductPlanDetailByPlanDetailId(Long planDetailId);
|
||||
|
||||
/**
|
||||
* 查询生产计划明细列表
|
||||
*
|
||||
* @param mesProductPlanDetail 生产计划明细
|
||||
* @return 生产计划明细集合
|
||||
*/
|
||||
public List<MesProductPlanDetail> selectMesProductPlanDetailList(MesProductPlanDetail mesProductPlanDetail);
|
||||
|
||||
/**
|
||||
* 新增生产计划明细
|
||||
*
|
||||
* @param mesProductPlanDetail 生产计划明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail);
|
||||
|
||||
/**
|
||||
* 修改生产计划明细
|
||||
*
|
||||
* @param mesProductPlanDetail 生产计划明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail);
|
||||
|
||||
/**
|
||||
* 删除生产计划明细
|
||||
*
|
||||
* @param planDetailId 生产计划明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesProductPlanDetailByPlanDetailId(Long planDetailId);
|
||||
|
||||
/**
|
||||
* 批量删除生产计划明细
|
||||
*
|
||||
* @param planDetailIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesProductPlanDetailByPlanDetailIds(Long[] planDetailIds);
|
||||
}
|
@ -0,0 +1,97 @@
|
||||
package com.hw.mes.mapper;
|
||||
|
||||
import java.util.List;
|
||||
import com.hw.mes.domain.MesProductPlan;
|
||||
import com.hw.mes.domain.MesProductPlanDetail;
|
||||
|
||||
/**
|
||||
* 生产派工Mapper接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-02-21
|
||||
*/
|
||||
public interface MesProductPlanMapper
|
||||
{
|
||||
/**
|
||||
* 查询生产派工
|
||||
*
|
||||
* @param planId 生产派工主键
|
||||
* @return 生产派工
|
||||
*/
|
||||
public MesProductPlan selectMesProductPlanByPlanId(Long planId);
|
||||
|
||||
/**
|
||||
* 查询生产派工列表
|
||||
*
|
||||
* @param mesProductPlan 生产派工
|
||||
* @return 生产派工集合
|
||||
*/
|
||||
public List<MesProductPlan> selectMesProductPlanList(MesProductPlan mesProductPlan);
|
||||
|
||||
/**
|
||||
* 新增生产派工
|
||||
*
|
||||
* @param mesProductPlan 生产派工
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesProductPlan(MesProductPlan mesProductPlan);
|
||||
|
||||
/**
|
||||
* 修改生产派工
|
||||
*
|
||||
* @param mesProductPlan 生产派工
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesProductPlan(MesProductPlan mesProductPlan);
|
||||
|
||||
/**
|
||||
* 删除生产派工
|
||||
*
|
||||
* @param planId 生产派工主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesProductPlanByPlanId(Long planId);
|
||||
|
||||
/**
|
||||
* 批量删除生产派工
|
||||
*
|
||||
* @param planIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesProductPlanByPlanIds(Long[] planIds);
|
||||
|
||||
/**
|
||||
* 批量删除生产计划明细
|
||||
*
|
||||
* @param planIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesProductPlanDetailByPlanIds(Long[] planIds);
|
||||
|
||||
/**
|
||||
* 批量新增生产计划明细
|
||||
*
|
||||
* @param mesProductPlanDetailList 生产计划明细列表
|
||||
* @return 结果
|
||||
*/
|
||||
public int batchMesProductPlanDetail(List<MesProductPlanDetail> mesProductPlanDetailList);
|
||||
|
||||
|
||||
/**
|
||||
* 通过生产派工主键删除生产计划明细信息
|
||||
*
|
||||
* @param planId 生产派工ID
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesProductPlanDetailByPlanId(Long planId);
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询生产派工列表,Join product_order和base_material
|
||||
*
|
||||
* @param mesProductPlan 生产派工
|
||||
* @return 生产派工集合
|
||||
*/
|
||||
public List<MesProductPlan> selectMesProductPlanJoinList(MesProductPlan mesProductPlan);
|
||||
}
|
@ -0,0 +1,74 @@
|
||||
package com.hw.mes.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.hw.mes.domain.MesProductPlanDetail;
|
||||
import com.hw.mes.domain.vo.MesProductPlanDetailVo;
|
||||
|
||||
/**
|
||||
* 生产计划明细Service接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-02-21
|
||||
*/
|
||||
public interface IMesProductPlanDetailService
|
||||
{
|
||||
/**
|
||||
* 查询生产计划明细
|
||||
*
|
||||
* @param planDetailId 生产计划明细主键
|
||||
* @return 生产计划明细
|
||||
*/
|
||||
public MesProductPlanDetail selectMesProductPlanDetailByPlanDetailId(Long planDetailId);
|
||||
|
||||
/**
|
||||
* 查询生产计划明细列表
|
||||
*
|
||||
* @param mesProductPlanDetail 生产计划明细
|
||||
* @return 生产计划明细集合
|
||||
*/
|
||||
public List<MesProductPlanDetail> selectMesProductPlanDetailList(MesProductPlanDetail mesProductPlanDetail);
|
||||
|
||||
/**
|
||||
* 新增生产计划明细
|
||||
*
|
||||
* @param mesProductPlanDetail 生产计划明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail);
|
||||
|
||||
/**
|
||||
* 修改生产计划明细
|
||||
*
|
||||
* @param mesProductPlanDetail 生产计划明细
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail);
|
||||
|
||||
/**
|
||||
* 批量删除生产计划明细
|
||||
*
|
||||
* @param planDetailIds 需要删除的生产计划明细主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesProductPlanDetailByPlanDetailIds(Long[] planDetailIds);
|
||||
|
||||
/**
|
||||
* 删除生产计划明细信息
|
||||
*
|
||||
* @param planDetailId 生产计划明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesProductPlanDetailByPlanDetailId(Long planDetailId);
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据生产计划新增生产计划明细
|
||||
*
|
||||
* @param mesProductPlanDetailVo 生产计划明细Vo
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesProductPlanDetails(MesProductPlanDetailVo mesProductPlanDetailVo);
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
package com.hw.mes.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.hw.mes.domain.MesProductPlan;
|
||||
|
||||
/**
|
||||
* 生产派工Service接口
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-02-21
|
||||
*/
|
||||
public interface IMesProductPlanService
|
||||
{
|
||||
/**
|
||||
* 查询生产派工
|
||||
*
|
||||
* @param planId 生产派工主键
|
||||
* @return 生产派工
|
||||
*/
|
||||
public MesProductPlan selectMesProductPlanByPlanId(Long planId);
|
||||
|
||||
/**
|
||||
* 查询生产派工列表
|
||||
*
|
||||
* @param mesProductPlan 生产派工
|
||||
* @return 生产派工集合
|
||||
*/
|
||||
public List<MesProductPlan> selectMesProductPlanList(MesProductPlan mesProductPlan);
|
||||
|
||||
/**
|
||||
* 新增生产派工
|
||||
*
|
||||
* @param mesProductPlan 生产派工
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMesProductPlan(MesProductPlan mesProductPlan);
|
||||
|
||||
/**
|
||||
* 修改生产派工
|
||||
*
|
||||
* @param mesProductPlan 生产派工
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMesProductPlan(MesProductPlan mesProductPlan);
|
||||
|
||||
/**
|
||||
* 批量删除生产派工
|
||||
*
|
||||
* @param planIds 需要删除的生产派工主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesProductPlanByPlanIds(Long[] planIds);
|
||||
|
||||
/**
|
||||
* 删除生产派工信息
|
||||
*
|
||||
* @param planId 生产派工主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMesProductPlanByPlanId(Long planId);
|
||||
|
||||
|
||||
/**
|
||||
* 查询生产派工列表Join product_order和base_material
|
||||
*
|
||||
* @param mesProductPlan 生产派工
|
||||
* @return 生产派工
|
||||
*/
|
||||
public List<MesProductPlan> selectMesProductPlanJoinList(MesProductPlan mesProductPlan);
|
||||
}
|
@ -0,0 +1,116 @@
|
||||
package com.hw.mes.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.hw.common.core.utils.DateUtils;
|
||||
import com.hw.mes.domain.vo.MesProductPlanDetailVo;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.hw.mes.mapper.MesProductPlanDetailMapper;
|
||||
import com.hw.mes.domain.MesProductPlanDetail;
|
||||
import com.hw.mes.service.IMesProductPlanDetailService;
|
||||
|
||||
/**
|
||||
* 生产计划明细Service业务层处理
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-02-21
|
||||
*/
|
||||
@Service
|
||||
public class MesProductPlanDetailServiceImpl implements IMesProductPlanDetailService
|
||||
{
|
||||
@Autowired
|
||||
private MesProductPlanDetailMapper mesProductPlanDetailMapper;
|
||||
|
||||
/**
|
||||
* 查询生产计划明细
|
||||
*
|
||||
* @param planDetailId 生产计划明细主键
|
||||
* @return 生产计划明细
|
||||
*/
|
||||
@Override
|
||||
public MesProductPlanDetail selectMesProductPlanDetailByPlanDetailId(Long planDetailId)
|
||||
{
|
||||
return mesProductPlanDetailMapper.selectMesProductPlanDetailByPlanDetailId(planDetailId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产计划明细列表
|
||||
*
|
||||
* @param mesProductPlanDetail 生产计划明细
|
||||
* @return 生产计划明细
|
||||
*/
|
||||
@Override
|
||||
public List<MesProductPlanDetail> selectMesProductPlanDetailList(MesProductPlanDetail mesProductPlanDetail)
|
||||
{
|
||||
return mesProductPlanDetailMapper.selectMesProductPlanDetailList(mesProductPlanDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产计划明细
|
||||
*
|
||||
* @param mesProductPlanDetail 生产计划明细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail)
|
||||
{
|
||||
mesProductPlanDetail.setCreateTime(DateUtils.getNowDate());
|
||||
return mesProductPlanDetailMapper.insertMesProductPlanDetail(mesProductPlanDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产计划明细
|
||||
*
|
||||
* @param mesProductPlanDetail 生产计划明细
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMesProductPlanDetail(MesProductPlanDetail mesProductPlanDetail)
|
||||
{
|
||||
mesProductPlanDetail.setUpdateTime(DateUtils.getNowDate());
|
||||
return mesProductPlanDetailMapper.updateMesProductPlanDetail(mesProductPlanDetail);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除生产计划明细
|
||||
*
|
||||
* @param planDetailIds 需要删除的生产计划明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMesProductPlanDetailByPlanDetailIds(Long[] planDetailIds)
|
||||
{
|
||||
return mesProductPlanDetailMapper.deleteMesProductPlanDetailByPlanDetailIds(planDetailIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产计划明细信息
|
||||
*
|
||||
* @param planDetailId 生产计划明细主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMesProductPlanDetailByPlanDetailId(Long planDetailId)
|
||||
{
|
||||
return mesProductPlanDetailMapper.deleteMesProductPlanDetailByPlanDetailId(planDetailId);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 根据生产计划新增生产计划明细
|
||||
*
|
||||
* @param mesProductPlanDetailVo 生产计划明细Vo
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMesProductPlanDetails(MesProductPlanDetailVo mesProductPlanDetailVo)
|
||||
{
|
||||
// mesProductPlanDetail.setCreateTime(DateUtils.getNowDate());
|
||||
// return mesProductPlanDetailMapper.insertMesProductPlanDetail(mesProductPlanDetail);
|
||||
// MesProductPlan mesProductPlan
|
||||
return 1;
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,156 @@
|
||||
package com.hw.mes.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
import com.hw.common.core.utils.DateUtils;
|
||||
import com.hw.common.security.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import java.util.ArrayList;
|
||||
import com.hw.common.core.utils.StringUtils;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
import com.hw.mes.domain.MesProductPlanDetail;
|
||||
import com.hw.mes.mapper.MesProductPlanMapper;
|
||||
import com.hw.mes.domain.MesProductPlan;
|
||||
import com.hw.mes.service.IMesProductPlanService;
|
||||
|
||||
/**
|
||||
* 生产派工Service业务层处理
|
||||
*
|
||||
* @author xins
|
||||
* @date 2024-02-21
|
||||
*/
|
||||
@Service
|
||||
public class MesProductPlanServiceImpl implements IMesProductPlanService
|
||||
{
|
||||
@Autowired
|
||||
private MesProductPlanMapper mesProductPlanMapper;
|
||||
|
||||
/**
|
||||
* 查询生产派工
|
||||
*
|
||||
* @param planId 生产派工主键
|
||||
* @return 生产派工
|
||||
*/
|
||||
@Override
|
||||
public MesProductPlan selectMesProductPlanByPlanId(Long planId)
|
||||
{
|
||||
return mesProductPlanMapper.selectMesProductPlanByPlanId(planId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询生产派工列表
|
||||
*
|
||||
* @param mesProductPlan 生产派工
|
||||
* @return 生产派工
|
||||
*/
|
||||
@Override
|
||||
public List<MesProductPlan> selectMesProductPlanList(MesProductPlan mesProductPlan)
|
||||
{
|
||||
return mesProductPlanMapper.selectMesProductPlanList(mesProductPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产派工
|
||||
*
|
||||
* @param mesProductPlan 生产派工
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int insertMesProductPlan(MesProductPlan mesProductPlan)
|
||||
{
|
||||
mesProductPlan.setCreateTime(DateUtils.getNowDate());
|
||||
int rows = mesProductPlanMapper.insertMesProductPlan(mesProductPlan);
|
||||
insertMesProductPlanDetail(mesProductPlan);
|
||||
return rows;
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改生产派工
|
||||
*
|
||||
* @param mesProductPlan 生产派工
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int updateMesProductPlan(MesProductPlan mesProductPlan)
|
||||
{
|
||||
mesProductPlan.setUpdateTime(DateUtils.getNowDate());
|
||||
mesProductPlanMapper.deleteMesProductPlanDetailByPlanId(mesProductPlan.getPlanId());
|
||||
insertMesProductPlanDetail(mesProductPlan);
|
||||
return mesProductPlanMapper.updateMesProductPlan(mesProductPlan);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除生产派工
|
||||
*
|
||||
* @param planIds 需要删除的生产派工主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteMesProductPlanByPlanIds(Long[] planIds)
|
||||
{
|
||||
mesProductPlanMapper.deleteMesProductPlanDetailByPlanIds(planIds);
|
||||
return mesProductPlanMapper.deleteMesProductPlanByPlanIds(planIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除生产派工信息
|
||||
*
|
||||
* @param planId 生产派工主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Transactional
|
||||
@Override
|
||||
public int deleteMesProductPlanByPlanId(Long planId)
|
||||
{
|
||||
mesProductPlanMapper.deleteMesProductPlanDetailByPlanId(planId);
|
||||
return mesProductPlanMapper.deleteMesProductPlanByPlanId(planId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增生产计划明细信息
|
||||
*
|
||||
* @param mesProductPlan 生产派工对象
|
||||
*/
|
||||
public void insertMesProductPlanDetail(MesProductPlan mesProductPlan)
|
||||
{
|
||||
List<MesProductPlanDetail> mesProductPlanDetailList = mesProductPlan.getMesProductPlanDetailList();
|
||||
Long planId = mesProductPlan.getPlanId();
|
||||
if (StringUtils.isNotNull(mesProductPlanDetailList))
|
||||
{
|
||||
List<MesProductPlanDetail> list = new ArrayList<MesProductPlanDetail>();
|
||||
for (MesProductPlanDetail mesProductPlanDetail : mesProductPlanDetailList)
|
||||
{
|
||||
mesProductPlanDetail.setPlanId(planId);
|
||||
list.add(mesProductPlanDetail);
|
||||
}
|
||||
if (list.size() > 0)
|
||||
{
|
||||
mesProductPlanMapper.batchMesProductPlanDetail(list);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 查询生产派工列表Join product_order和base_material
|
||||
*
|
||||
* @param mesProductPlan 生产派工
|
||||
* @return 生产派工
|
||||
*/
|
||||
@Override
|
||||
public List<MesProductPlan> selectMesProductPlanJoinList(MesProductPlan mesProductPlan)
|
||||
{
|
||||
Long stationId = SecurityUtils.getStationd();
|
||||
System.out.println("stationId: " + stationId);
|
||||
return mesProductPlanMapper.selectMesProductPlanJoinList(mesProductPlan);
|
||||
}
|
||||
|
||||
}
|
@ -0,0 +1,84 @@
|
||||
<?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.hw.mes.mapper.MesMaterialCheckResultMapper">
|
||||
|
||||
<resultMap type="MesMaterialCheckResult" id="MesMaterialCheckResultResult">
|
||||
<result property="materialCheckResultId" column="material_check_result_id" />
|
||||
<result property="planId" column="plan_id" />
|
||||
<result property="planDetailId" column="plan_detail_id" />
|
||||
<result property="materialId" column="material_id" />
|
||||
<result property="standardAmount" column="standard_amount" />
|
||||
<result property="checkAmount" column="check_amount" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMesMaterialCheckResultVo">
|
||||
select material_check_result_id, plan_id, plan_detail_id, material_id, standard_amount, check_amount, update_by, update_time from mes_material_check_result
|
||||
</sql>
|
||||
|
||||
<select id="selectMesMaterialCheckResultList" parameterType="MesMaterialCheckResult" resultMap="MesMaterialCheckResultResult">
|
||||
<include refid="selectMesMaterialCheckResultVo"/>
|
||||
<where>
|
||||
<if test="planId != null "> and plan_id = #{planId}</if>
|
||||
<if test="planDetailId != null "> and plan_detail_id = #{planDetailId}</if>
|
||||
<if test="materialId != null "> and material_id = #{materialId}</if>
|
||||
<if test="standardAmount != null "> and standard_amount = #{standardAmount}</if>
|
||||
<if test="checkAmount != null "> and check_amount = #{checkAmount}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMesMaterialCheckResultByMaterialCheckResultId" parameterType="Long" resultMap="MesMaterialCheckResultResult">
|
||||
<include refid="selectMesMaterialCheckResultVo"/>
|
||||
where material_check_result_id = #{materialCheckResultId}
|
||||
</select>
|
||||
|
||||
<insert id="insertMesMaterialCheckResult" parameterType="MesMaterialCheckResult" useGeneratedKeys="true" keyProperty="materialCheckResultId">
|
||||
insert into mes_material_check_result
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="planId != null">plan_id,</if>
|
||||
<if test="planDetailId != null">plan_detail_id,</if>
|
||||
<if test="materialId != null">material_id,</if>
|
||||
<if test="standardAmount != null">standard_amount,</if>
|
||||
<if test="checkAmount != null">check_amount,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="planId != null">#{planId},</if>
|
||||
<if test="planDetailId != null">#{planDetailId},</if>
|
||||
<if test="materialId != null">#{materialId},</if>
|
||||
<if test="standardAmount != null">#{standardAmount},</if>
|
||||
<if test="checkAmount != null">#{checkAmount},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMesMaterialCheckResult" parameterType="MesMaterialCheckResult">
|
||||
update mes_material_check_result
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="planId != null">plan_id = #{planId},</if>
|
||||
<if test="planDetailId != null">plan_detail_id = #{planDetailId},</if>
|
||||
<if test="materialId != null">material_id = #{materialId},</if>
|
||||
<if test="standardAmount != null">standard_amount = #{standardAmount},</if>
|
||||
<if test="checkAmount != null">check_amount = #{checkAmount},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where material_check_result_id = #{materialCheckResultId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMesMaterialCheckResultByMaterialCheckResultId" parameterType="Long">
|
||||
delete from mes_material_check_result where material_check_result_id = #{materialCheckResultId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMesMaterialCheckResultByMaterialCheckResultIds" parameterType="String">
|
||||
delete from mes_material_check_result where material_check_result_id in
|
||||
<foreach item="materialCheckResultId" collection="array" open="(" separator="," close=")">
|
||||
#{materialCheckResultId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,116 @@
|
||||
<?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.hw.mes.mapper.MesProductPlanDetailMapper">
|
||||
|
||||
<resultMap type="MesProductPlanDetail" id="MesProductPlanDetailResult">
|
||||
<result property="planDetailId" column="plan_detail_id" />
|
||||
<result property="planDetailCode" column="plan_detail_code" />
|
||||
<result property="planId" column="plan_id" />
|
||||
<result property="planCode" column="plan_code" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="userName" column="user_name" />
|
||||
<result property="realBeginTime" column="real_begin_time" />
|
||||
<result property="realEndTime" column="real_end_time" />
|
||||
<result property="planDetailStatus" column="plan_detail_status" />
|
||||
<result property="isFlag" column="is_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMesProductPlanDetailVo">
|
||||
select plan_detail_id, plan_detail_code, plan_id, plan_code, user_id, user_name, real_begin_time, real_end_time, plan_detail_status, is_flag, remark, create_by, create_time, update_by, update_time from mes_product_plan_detail
|
||||
</sql>
|
||||
|
||||
<select id="selectMesProductPlanDetailList" parameterType="MesProductPlanDetail" resultMap="MesProductPlanDetailResult">
|
||||
<include refid="selectMesProductPlanDetailVo"/>
|
||||
<where>
|
||||
<if test="planDetailCode != null and planDetailCode != ''"> and plan_detail_code = #{planDetailCode}</if>
|
||||
<if test="planId != null "> and plan_id = #{planId}</if>
|
||||
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
|
||||
<if test="realBeginTime != null "> and real_begin_time = #{realBeginTime}</if>
|
||||
<if test="realEndTime != null "> and real_end_time = #{realEndTime}</if>
|
||||
<if test="planDetailStatus != null and planDetailStatus != ''"> and plan_detail_status = #{planDetailStatus}</if>
|
||||
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMesProductPlanDetailByPlanDetailId" parameterType="Long" resultMap="MesProductPlanDetailResult">
|
||||
<include refid="selectMesProductPlanDetailVo"/>
|
||||
where plan_detail_id = #{planDetailId}
|
||||
</select>
|
||||
|
||||
<insert id="insertMesProductPlanDetail" parameterType="MesProductPlanDetail" useGeneratedKeys="true" keyProperty="planDetailId">
|
||||
insert into mes_product_plan_detail
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="planDetailCode != null and planDetailCode != ''">plan_detail_code,</if>
|
||||
<if test="planId != null">plan_id,</if>
|
||||
<if test="planCode != null and planCode != ''">plan_code,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="userName != null">user_name,</if>
|
||||
<if test="realBeginTime != null">real_begin_time,</if>
|
||||
<if test="realEndTime != null">real_end_time,</if>
|
||||
<if test="planDetailStatus != null and planDetailStatus != ''">plan_detail_status,</if>
|
||||
<if test="isFlag != null and isFlag != ''">is_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="planDetailCode != null and planDetailCode != ''">#{planDetailCode},</if>
|
||||
<if test="planId != null">#{planId},</if>
|
||||
<if test="planCode != null and planCode != ''">#{planCode},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="userName != null">#{userName},</if>
|
||||
<if test="realBeginTime != null">#{realBeginTime},</if>
|
||||
<if test="realEndTime != null">#{realEndTime},</if>
|
||||
<if test="planDetailStatus != null and planDetailStatus != ''">#{planDetailStatus},</if>
|
||||
<if test="isFlag != null and isFlag != ''">#{isFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMesProductPlanDetail" parameterType="MesProductPlanDetail">
|
||||
update mes_product_plan_detail
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="planDetailCode != null and planDetailCode != ''">plan_detail_code = #{planDetailCode},</if>
|
||||
<if test="planId != null">plan_id = #{planId},</if>
|
||||
<if test="planCode != null and planCode != ''">plan_code = #{planCode},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="userName != null">user_name = #{userName},</if>
|
||||
<if test="realBeginTime != null">real_begin_time = #{realBeginTime},</if>
|
||||
<if test="realEndTime != null">real_end_time = #{realEndTime},</if>
|
||||
<if test="planDetailStatus != null and planDetailStatus != ''">plan_detail_status = #{planDetailStatus},</if>
|
||||
<if test="isFlag != null and isFlag != ''">is_flag = #{isFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where plan_detail_id = #{planDetailId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMesProductPlanDetailByPlanDetailId" parameterType="Long">
|
||||
delete from mes_product_plan_detail where plan_detail_id = #{planDetailId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMesProductPlanDetailByPlanDetailIds" parameterType="String">
|
||||
delete from mes_product_plan_detail where plan_detail_id in
|
||||
<foreach item="planDetailId" collection="array" open="(" separator="," close=")">
|
||||
#{planDetailId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
@ -0,0 +1,241 @@
|
||||
<?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.hw.mes.mapper.MesProductPlanMapper">
|
||||
|
||||
<resultMap type="MesProductPlan" id="MesProductPlanResult">
|
||||
<result property="planId" column="plan_id" />
|
||||
<result property="productOrderId" column="product_order_id" />
|
||||
<result property="planCode" column="plan_code" />
|
||||
<result property="dispatchCode" column="dispatch_code" />
|
||||
<result property="materialId" column="material_id" />
|
||||
<result property="materialBomId" column="material_bom_id" />
|
||||
<result property="processId" column="process_id" />
|
||||
<result property="processOrder" column="process_order" />
|
||||
<result property="lastProcessId" column="last_process_id" />
|
||||
<result property="stationId" column="station_id" />
|
||||
<result property="userId" column="user_id" />
|
||||
<result property="productionTime" column="production_time" />
|
||||
<result property="planAmount" column="plan_amount" />
|
||||
<result property="completeAmount" column="complete_amount" />
|
||||
<result property="planBeginTime" column="plan_begin_time" />
|
||||
<result property="planEndTime" column="plan_end_time" />
|
||||
<result property="realBeginTime" column="real_begin_time" />
|
||||
<result property="realEndTime" column="real_end_time" />
|
||||
<result property="attachId" column="attach_id" />
|
||||
<result property="planStatus" column="plan_status" />
|
||||
<result property="isFlag" column="is_flag" />
|
||||
<result property="remark" column="remark" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
<result property="updateTime" column="update_time" />
|
||||
<result property="planDeliveryDate" column="plan_delivery_date" />
|
||||
<result property="materialName" column="material_name" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap id="MesProductPlanMesProductPlanDetailResult" type="MesProductPlan" extends="MesProductPlanResult">
|
||||
<collection property="mesProductPlanDetailList" notNullColumn="sub_plan_detail_id" javaType="java.util.List" resultMap="MesProductPlanDetailResult" />
|
||||
</resultMap>
|
||||
|
||||
<resultMap type="MesProductPlanDetail" id="MesProductPlanDetailResult">
|
||||
<result property="planDetailId" column="sub_plan_detail_id" />
|
||||
<result property="planDetailCode" column="sub_plan_detail_code" />
|
||||
<result property="planId" column="sub_plan_id" />
|
||||
<result property="planCode" column="sub_plan_code" />
|
||||
<result property="userId" column="sub_user_id" />
|
||||
<result property="userName" column="sub_user_name" />
|
||||
<result property="realBeginTime" column="sub_real_begin_time" />
|
||||
<result property="realEndTime" column="sub_real_end_time" />
|
||||
<result property="planDetailStatus" column="sub_plan_detail_status" />
|
||||
<result property="isFlag" column="sub_is_flag" />
|
||||
<result property="remark" column="sub_remark" />
|
||||
<result property="createBy" column="sub_create_by" />
|
||||
<result property="createTime" column="sub_create_time" />
|
||||
<result property="updateBy" column="sub_update_by" />
|
||||
<result property="updateTime" column="sub_update_time" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMesProductPlanVo">
|
||||
select plan_id, product_order_id, plan_code, dispatch_code, material_id, material_bom_id, process_id, process_order, last_process_id, station_id, user_id, production_time, plan_amount, complete_amount, plan_begin_time, plan_end_time, real_begin_time, real_end_time, attach_id, plan_status, is_flag, remark, create_by, create_time, update_by, update_time from mes_product_plan
|
||||
</sql>
|
||||
|
||||
<select id="selectMesProductPlanList" parameterType="MesProductPlan" resultMap="MesProductPlanResult">
|
||||
<include refid="selectMesProductPlanVo"/>
|
||||
<where>
|
||||
<if test="productOrderId != null "> and product_order_id = #{productOrderId}</if>
|
||||
<if test="planCode != null and planCode != ''"> and plan_code = #{planCode}</if>
|
||||
<if test="dispatchCode != null and dispatchCode != ''"> and dispatch_code = #{dispatchCode}</if>
|
||||
<if test="materialId != null "> and material_id = #{materialId}</if>
|
||||
<if test="materialBomId != null "> and material_bom_id = #{materialBomId}</if>
|
||||
<if test="processId != null "> and process_id = #{processId}</if>
|
||||
<if test="processOrder != null "> and process_order = #{processOrder}</if>
|
||||
<if test="lastProcessId != null "> and last_process_id = #{lastProcessId}</if>
|
||||
<if test="stationId != null "> and station_id = #{stationId}</if>
|
||||
<if test="userId != null "> and user_id = #{userId}</if>
|
||||
<if test="productionTime != null "> and production_time = #{productionTime}</if>
|
||||
<if test="planAmount != null "> and plan_amount = #{planAmount}</if>
|
||||
<if test="completeAmount != null "> and complete_amount = #{completeAmount}</if>
|
||||
<if test="planBeginTime != null "> and plan_begin_time = #{planBeginTime}</if>
|
||||
<if test="planEndTime != null "> and plan_end_time = #{planEndTime}</if>
|
||||
<if test="realBeginTime != null "> and real_begin_time = #{realBeginTime}</if>
|
||||
<if test="realEndTime != null "> and real_end_time = #{realEndTime}</if>
|
||||
<if test="attachId != null and attachId != ''"> and attach_id = #{attachId}</if>
|
||||
<if test="planStatus != null and planStatus != ''"> and plan_status = #{planStatus}</if>
|
||||
<if test="isFlag != null and isFlag != ''"> and is_flag = #{isFlag}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMesProductPlanByPlanId" parameterType="Long" resultMap="MesProductPlanMesProductPlanDetailResult">
|
||||
select a.plan_id, a.product_order_id, a.plan_code, a.dispatch_code, a.material_id, a.material_bom_id, a.process_id, a.process_order, a.last_process_id, a.station_id, a.user_id, a.production_time, a.plan_amount, a.complete_amount, a.plan_begin_time, a.plan_end_time, a.real_begin_time, a.real_end_time, a.attach_id, a.plan_status, a.is_flag, a.remark, a.create_by, a.create_time, a.update_by, a.update_time,
|
||||
b.plan_detail_id as sub_plan_detail_id, b.plan_detail_code as sub_plan_detail_code, b.plan_id as sub_plan_id, b.plan_code as sub_plan_code, b.user_id as sub_user_id, b.user_name as sub_user_name, b.real_begin_time as sub_real_begin_time, b.real_end_time as sub_real_end_time, b.plan_detail_status as sub_plan_detail_status, b.is_flag as sub_is_flag, b.remark as sub_remark, b.create_by as sub_create_by, b.create_time as sub_create_time, b.update_by as sub_update_by, b.update_time as sub_update_time
|
||||
from mes_product_plan a
|
||||
left join mes_product_plan_detail b on b.plan_id = a.plan_id
|
||||
where a.plan_id = #{planId}
|
||||
</select>
|
||||
|
||||
<insert id="insertMesProductPlan" parameterType="MesProductPlan" useGeneratedKeys="true" keyProperty="planId">
|
||||
insert into mes_product_plan
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="productOrderId != null">product_order_id,</if>
|
||||
<if test="planCode != null and planCode != ''">plan_code,</if>
|
||||
<if test="dispatchCode != null and dispatchCode != ''">dispatch_code,</if>
|
||||
<if test="materialId != null">material_id,</if>
|
||||
<if test="materialBomId != null">material_bom_id,</if>
|
||||
<if test="processId != null">process_id,</if>
|
||||
<if test="processOrder != null">process_order,</if>
|
||||
<if test="lastProcessId != null">last_process_id,</if>
|
||||
<if test="stationId != null">station_id,</if>
|
||||
<if test="userId != null">user_id,</if>
|
||||
<if test="productionTime != null">production_time,</if>
|
||||
<if test="planAmount != null">plan_amount,</if>
|
||||
<if test="completeAmount != null">complete_amount,</if>
|
||||
<if test="planBeginTime != null">plan_begin_time,</if>
|
||||
<if test="planEndTime != null">plan_end_time,</if>
|
||||
<if test="realBeginTime != null">real_begin_time,</if>
|
||||
<if test="realEndTime != null">real_end_time,</if>
|
||||
<if test="attachId != null">attach_id,</if>
|
||||
<if test="planStatus != null and planStatus != ''">plan_status,</if>
|
||||
<if test="isFlag != null and isFlag != ''">is_flag,</if>
|
||||
<if test="remark != null">remark,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
<if test="createTime != null">create_time,</if>
|
||||
<if test="updateBy != null">update_by,</if>
|
||||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="productOrderId != null">#{productOrderId},</if>
|
||||
<if test="planCode != null and planCode != ''">#{planCode},</if>
|
||||
<if test="dispatchCode != null and dispatchCode != ''">#{dispatchCode},</if>
|
||||
<if test="materialId != null">#{materialId},</if>
|
||||
<if test="materialBomId != null">#{materialBomId},</if>
|
||||
<if test="processId != null">#{processId},</if>
|
||||
<if test="processOrder != null">#{processOrder},</if>
|
||||
<if test="lastProcessId != null">#{lastProcessId},</if>
|
||||
<if test="stationId != null">#{stationId},</if>
|
||||
<if test="userId != null">#{userId},</if>
|
||||
<if test="productionTime != null">#{productionTime},</if>
|
||||
<if test="planAmount != null">#{planAmount},</if>
|
||||
<if test="completeAmount != null">#{completeAmount},</if>
|
||||
<if test="planBeginTime != null">#{planBeginTime},</if>
|
||||
<if test="planEndTime != null">#{planEndTime},</if>
|
||||
<if test="realBeginTime != null">#{realBeginTime},</if>
|
||||
<if test="realEndTime != null">#{realEndTime},</if>
|
||||
<if test="attachId != null">#{attachId},</if>
|
||||
<if test="planStatus != null and planStatus != ''">#{planStatus},</if>
|
||||
<if test="isFlag != null and isFlag != ''">#{isFlag},</if>
|
||||
<if test="remark != null">#{remark},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
<if test="createTime != null">#{createTime},</if>
|
||||
<if test="updateBy != null">#{updateBy},</if>
|
||||
<if test="updateTime != null">#{updateTime},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMesProductPlan" parameterType="MesProductPlan">
|
||||
update mes_product_plan
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="productOrderId != null">product_order_id = #{productOrderId},</if>
|
||||
<if test="planCode != null and planCode != ''">plan_code = #{planCode},</if>
|
||||
<if test="dispatchCode != null and dispatchCode != ''">dispatch_code = #{dispatchCode},</if>
|
||||
<if test="materialId != null">material_id = #{materialId},</if>
|
||||
<if test="materialBomId != null">material_bom_id = #{materialBomId},</if>
|
||||
<if test="processId != null">process_id = #{processId},</if>
|
||||
<if test="processOrder != null">process_order = #{processOrder},</if>
|
||||
<if test="lastProcessId != null">last_process_id = #{lastProcessId},</if>
|
||||
<if test="stationId != null">station_id = #{stationId},</if>
|
||||
<if test="userId != null">user_id = #{userId},</if>
|
||||
<if test="productionTime != null">production_time = #{productionTime},</if>
|
||||
<if test="planAmount != null">plan_amount = #{planAmount},</if>
|
||||
<if test="completeAmount != null">complete_amount = #{completeAmount},</if>
|
||||
<if test="planBeginTime != null">plan_begin_time = #{planBeginTime},</if>
|
||||
<if test="planEndTime != null">plan_end_time = #{planEndTime},</if>
|
||||
<if test="realBeginTime != null">real_begin_time = #{realBeginTime},</if>
|
||||
<if test="realEndTime != null">real_end_time = #{realEndTime},</if>
|
||||
<if test="attachId != null">attach_id = #{attachId},</if>
|
||||
<if test="planStatus != null and planStatus != ''">plan_status = #{planStatus},</if>
|
||||
<if test="isFlag != null and isFlag != ''">is_flag = #{isFlag},</if>
|
||||
<if test="remark != null">remark = #{remark},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
<if test="createTime != null">create_time = #{createTime},</if>
|
||||
<if test="updateBy != null">update_by = #{updateBy},</if>
|
||||
<if test="updateTime != null">update_time = #{updateTime},</if>
|
||||
</trim>
|
||||
where plan_id = #{planId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMesProductPlanByPlanId" parameterType="Long">
|
||||
delete from mes_product_plan where plan_id = #{planId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMesProductPlanByPlanIds" parameterType="String">
|
||||
delete from mes_product_plan where plan_id in
|
||||
<foreach item="planId" collection="array" open="(" separator="," close=")">
|
||||
#{planId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMesProductPlanDetailByPlanIds" parameterType="String">
|
||||
delete from mes_product_plan_detail where plan_id in
|
||||
<foreach item="planId" collection="array" open="(" separator="," close=")">
|
||||
#{planId}
|
||||
</foreach>
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMesProductPlanDetailByPlanId" parameterType="Long">
|
||||
delete from mes_product_plan_detail where plan_id = #{planId}
|
||||
</delete>
|
||||
|
||||
<insert id="batchMesProductPlanDetail">
|
||||
insert into mes_product_plan_detail( plan_detail_id, plan_detail_code, plan_id, plan_code, user_id, user_name, real_begin_time, real_end_time, plan_detail_status, is_flag, remark, create_by, create_time, update_by, update_time) values
|
||||
<foreach item="item" index="index" collection="list" separator=",">
|
||||
( #{item.planDetailId}, #{item.planDetailCode}, #{item.planId}, #{item.planCode}, #{item.userId}, #{item.userName}, #{item.realBeginTime}, #{item.realEndTime}, #{item.planDetailStatus}, #{item.isFlag}, #{item.remark}, #{item.createBy}, #{item.createTime}, #{item.updateBy}, #{item.updateTime})
|
||||
</foreach>
|
||||
</insert>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
<select id="selectMesProductPlanJoinList" parameterType="MesProductPlan" resultMap="MesProductPlanResult">
|
||||
select mpp.plan_id, mpp.product_order_id, mpp.plan_code, mpp.dispatch_code, mpp.material_id, mpp.material_bom_id, mpp.process_id, mpp.process_order, mpp.last_process_id,
|
||||
mpp.station_id, mpp.plan_amount, mpp.complete_amount, mpp.plan_begin_time, mpp.plan_end_time, mpp.real_begin_time, mpp.real_end_time,
|
||||
mpp.attach_id, mpp.plan_status, mpo.plan_delivery_date,mbmi.material_name
|
||||
from mes_product_plan mpp left join mes_product_order mpo on mpp.product_order_id = mpo.product_order_id
|
||||
left join mes_base_material_info mbmi on mpp.material_id=mbmi.material_id
|
||||
<where>
|
||||
<if test="stationId != null "> and mpp.station_id = #{stationId}</if>
|
||||
<if test="planStatus != null and planStatus != ''"> and mpp.plan_status = #{planStatus}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
</mapper>
|
Loading…
Reference in New Issue