change - 物料过点数据、质检添加过点数据
parent
907a5822ef
commit
07ea6b8007
@ -0,0 +1,99 @@
|
||||
package com.aucma.report.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.aucma.common.utils.DateUtils;
|
||||
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 com.aucma.common.annotation.Log;
|
||||
import com.aucma.common.core.controller.BaseController;
|
||||
import com.aucma.common.core.domain.AjaxResult;
|
||||
import com.aucma.common.enums.BusinessType;
|
||||
import com.aucma.report.domain.MaterialCompletion;
|
||||
import com.aucma.report.service.IMaterialCompletionService;
|
||||
import com.aucma.common.utils.poi.ExcelUtil;
|
||||
import com.aucma.common.core.page.TableDataInfo;
|
||||
|
||||
/**
|
||||
* 物料过点记录Controller
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-03-14
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/report/materialCompletion")
|
||||
public class MaterialCompletionController extends BaseController {
|
||||
@Autowired
|
||||
private IMaterialCompletionService materialCompletionService;
|
||||
|
||||
/**
|
||||
* 查询物料过点记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('report:materialCompletion:list')")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(MaterialCompletion materialCompletion) {
|
||||
startPage();
|
||||
List<MaterialCompletion> list = materialCompletionService.selectMaterialCompletionList(materialCompletion);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出物料过点记录列表
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('report:materialCompletion:export')")
|
||||
@Log(title = "物料过点记录", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, MaterialCompletion materialCompletion) {
|
||||
List<MaterialCompletion> list = materialCompletionService.selectMaterialCompletionList(materialCompletion);
|
||||
ExcelUtil<MaterialCompletion> util = new ExcelUtil<MaterialCompletion>(MaterialCompletion.class);
|
||||
util.exportExcel(response, list, "物料过点记录数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物料过点记录详细信息
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('report:materialCompletion:query')")
|
||||
@GetMapping(value = "/{objId}")
|
||||
public AjaxResult getInfo(@PathVariable("objId") Long objId) {
|
||||
return success(materialCompletionService.selectMaterialCompletionByObjId(objId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物料过点记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('report:materialCompletion:add')")
|
||||
@Log(title = "物料过点记录", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody MaterialCompletion materialCompletion) {
|
||||
return toAjax(materialCompletionService.insertMaterialCompletion(materialCompletion));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物料过点记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('report:materialCompletion:edit')")
|
||||
@Log(title = "物料过点记录", businessType = BusinessType.UPDATE)
|
||||
@PutMapping
|
||||
public AjaxResult edit(@RequestBody MaterialCompletion materialCompletion) {
|
||||
return toAjax(materialCompletionService.updateMaterialCompletion(materialCompletion));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物料过点记录
|
||||
*/
|
||||
@PreAuthorize("@ss.hasPermi('report:materialCompletion:remove')")
|
||||
@Log(title = "物料过点记录", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{objIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] objIds) {
|
||||
return toAjax(materialCompletionService.deleteMaterialCompletionByObjIds(objIds));
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,65 @@
|
||||
package com.aucma.report.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.aucma.common.annotation.DataSource;
|
||||
import com.aucma.common.enums.DataSourceType;
|
||||
import com.aucma.report.domain.MaterialCompletion;
|
||||
|
||||
/**
|
||||
* 物料过点记录Mapper接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-03-14
|
||||
*/
|
||||
@DataSource(value = DataSourceType.SLAVE)
|
||||
public interface MaterialCompletionMapper
|
||||
{
|
||||
/**
|
||||
* 查询物料过点记录
|
||||
*
|
||||
* @param objId 物料过点记录主键
|
||||
* @return 物料过点记录
|
||||
*/
|
||||
public MaterialCompletion selectMaterialCompletionByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询物料过点记录列表
|
||||
*
|
||||
* @param materialCompletion 物料过点记录
|
||||
* @return 物料过点记录集合
|
||||
*/
|
||||
public List<MaterialCompletion> selectMaterialCompletionList(MaterialCompletion materialCompletion);
|
||||
|
||||
/**
|
||||
* 新增物料过点记录
|
||||
*
|
||||
* @param materialCompletion 物料过点记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMaterialCompletion(MaterialCompletion materialCompletion);
|
||||
|
||||
/**
|
||||
* 修改物料过点记录
|
||||
*
|
||||
* @param materialCompletion 物料过点记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMaterialCompletion(MaterialCompletion materialCompletion);
|
||||
|
||||
/**
|
||||
* 删除物料过点记录
|
||||
*
|
||||
* @param objId 物料过点记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMaterialCompletionByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 批量删除物料过点记录
|
||||
*
|
||||
* @param objIds 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMaterialCompletionByObjIds(Long[] objIds);
|
||||
}
|
||||
@ -0,0 +1,68 @@
|
||||
package com.aucma.report.service;
|
||||
|
||||
import java.util.List;
|
||||
import com.aucma.report.domain.MaterialCompletion;
|
||||
import com.aucma.report.domain.ReportQualityInspection;
|
||||
|
||||
/**
|
||||
* 物料过点记录Service接口
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-03-14
|
||||
*/
|
||||
public interface IMaterialCompletionService
|
||||
{
|
||||
/**
|
||||
* 查询物料过点记录
|
||||
*
|
||||
* @param objId 物料过点记录主键
|
||||
* @return 物料过点记录
|
||||
*/
|
||||
public MaterialCompletion selectMaterialCompletionByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 查询物料过点记录列表
|
||||
*
|
||||
* @param materialCompletion 物料过点记录
|
||||
* @return 物料过点记录集合
|
||||
*/
|
||||
public List<MaterialCompletion> selectMaterialCompletionList(MaterialCompletion materialCompletion);
|
||||
|
||||
/**
|
||||
* 新增物料过点记录
|
||||
*
|
||||
* @param materialCompletion 物料过点记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertMaterialCompletion(MaterialCompletion materialCompletion);
|
||||
|
||||
/**
|
||||
* 修改物料过点记录
|
||||
*
|
||||
* @param materialCompletion 物料过点记录
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateMaterialCompletion(MaterialCompletion materialCompletion);
|
||||
|
||||
/**
|
||||
* 批量删除物料过点记录
|
||||
*
|
||||
* @param objIds 需要删除的物料过点记录主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMaterialCompletionByObjIds(Long[] objIds);
|
||||
|
||||
/**
|
||||
* 删除物料过点记录信息
|
||||
*
|
||||
* @param objId 物料过点记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteMaterialCompletionByObjId(Long objId);
|
||||
|
||||
/**
|
||||
* 二线质检存入过点数据
|
||||
* @param inspection
|
||||
*/
|
||||
void inspectionProcessing(ReportQualityInspection inspection);
|
||||
}
|
||||
@ -0,0 +1,110 @@
|
||||
package com.aucma.report.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.aucma.report.domain.ReportQualityInspection;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.aucma.report.mapper.MaterialCompletionMapper;
|
||||
import com.aucma.report.domain.MaterialCompletion;
|
||||
import com.aucma.report.service.IMaterialCompletionService;
|
||||
|
||||
/**
|
||||
* 物料过点记录Service业务层处理
|
||||
*
|
||||
* @author Yinq
|
||||
* @date 2024-03-14
|
||||
*/
|
||||
@Service
|
||||
public class MaterialCompletionServiceImpl implements IMaterialCompletionService {
|
||||
@Autowired
|
||||
private MaterialCompletionMapper materialCompletionMapper;
|
||||
|
||||
/**
|
||||
* 查询物料过点记录
|
||||
*
|
||||
* @param objId 物料过点记录主键
|
||||
* @return 物料过点记录
|
||||
*/
|
||||
@Override
|
||||
public MaterialCompletion selectMaterialCompletionByObjId(Long objId) {
|
||||
return materialCompletionMapper.selectMaterialCompletionByObjId(objId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物料过点记录列表
|
||||
*
|
||||
* @param materialCompletion 物料过点记录
|
||||
* @return 物料过点记录
|
||||
*/
|
||||
@Override
|
||||
public List<MaterialCompletion> selectMaterialCompletionList(MaterialCompletion materialCompletion) {
|
||||
return materialCompletionMapper.selectMaterialCompletionList(materialCompletion);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物料过点记录
|
||||
*
|
||||
* @param materialCompletion 物料过点记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int insertMaterialCompletion(MaterialCompletion materialCompletion) {
|
||||
return materialCompletionMapper.insertMaterialCompletion(materialCompletion);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物料过点记录
|
||||
*
|
||||
* @param materialCompletion 物料过点记录
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int updateMaterialCompletion(MaterialCompletion materialCompletion) {
|
||||
return materialCompletionMapper.updateMaterialCompletion(materialCompletion);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除物料过点记录
|
||||
*
|
||||
* @param objIds 需要删除的物料过点记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMaterialCompletionByObjIds(Long[] objIds) {
|
||||
return materialCompletionMapper.deleteMaterialCompletionByObjIds(objIds);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物料过点记录信息
|
||||
*
|
||||
* @param objId 物料过点记录主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
public int deleteMaterialCompletionByObjId(Long objId) {
|
||||
return materialCompletionMapper.deleteMaterialCompletionByObjId(objId);
|
||||
}
|
||||
|
||||
/**
|
||||
* 二线质检存入过点数据
|
||||
* @param inspection
|
||||
*/
|
||||
@Override
|
||||
public void inspectionProcessing(ReportQualityInspection inspection) {
|
||||
MaterialCompletion materialCompletion = new MaterialCompletion();
|
||||
//质检转过点数据
|
||||
// if (StringUtils.isNotEmpty(inspection.getBarCode())){
|
||||
// //1001
|
||||
// }
|
||||
// materialCompletion.setOrderCode();
|
||||
// materialCompletion.setPlanCode();
|
||||
materialCompletion.setMaterialBarcode(inspection.getBarCode());
|
||||
materialCompletion.setMaterialName(inspection.getMaterialName());
|
||||
materialCompletion.setStationName(inspection.getStationCode());
|
||||
materialCompletion.setCompleteDate(inspection.getInspectorTime());
|
||||
materialCompletion.setProductLineCode("CX_02");
|
||||
materialCompletionMapper.insertMaterialCompletion(materialCompletion);
|
||||
}
|
||||
|
||||
}
|
||||
@ -0,0 +1,124 @@
|
||||
<?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.aucma.report.mapper.MaterialCompletionMapper">
|
||||
|
||||
<resultMap type="MaterialCompletion" id="MaterialCompletionResult">
|
||||
<result property="objId" column="obj_id"/>
|
||||
<result property="orderCode" column="order_code"/>
|
||||
<result property="materialBarcode" column="material_barcode"/>
|
||||
<result property="materialCode" column="material_code"/>
|
||||
<result property="materialName" column="material_name"/>
|
||||
<result property="stationName" column="station_name"/>
|
||||
<result property="completeDate" column="complete_date"/>
|
||||
<result property="planCode" column="plan_code"/>
|
||||
<result property="productLineCode" column="product_line_code"/>
|
||||
<result property="isDownLine" column="is_down_line"/>
|
||||
<result property="productionCode" column="production_code"/>
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectMaterialCompletionVo">
|
||||
select obj_id,
|
||||
order_code,
|
||||
material_barcode,
|
||||
material_code,
|
||||
material_name,
|
||||
station_name,
|
||||
complete_date,
|
||||
plan_code,
|
||||
product_line_code,
|
||||
is_down_line,
|
||||
production_code
|
||||
from material_completion
|
||||
</sql>
|
||||
|
||||
<select id="selectMaterialCompletionList" parameterType="MaterialCompletion" resultMap="MaterialCompletionResult">
|
||||
<include refid="selectMaterialCompletionVo"/>
|
||||
<where>
|
||||
<if test="orderCode != null and orderCode != ''">and order_code = #{orderCode}</if>
|
||||
<if test="materialBarcode != null and materialBarcode != ''">and material_barcode = #{materialBarcode}</if>
|
||||
<if test="materialCode != null and materialCode != ''">and material_code = #{materialCode}</if>
|
||||
<if test="materialName != null and materialName != ''">and material_name like concat(concat('%',
|
||||
#{materialName}), '%')
|
||||
</if>
|
||||
<if test="stationName != null and stationName != ''">and station_name like concat(concat('%',
|
||||
#{stationName}), '%')
|
||||
</if>
|
||||
<if test="completeDate != null ">and complete_date = #{completeDate}</if>
|
||||
<if test="planCode != null and planCode != ''">and plan_code = #{planCode}</if>
|
||||
<if test="productLineCode != null and productLineCode != ''">and product_line_code = #{productLineCode}
|
||||
</if>
|
||||
<if test="isDownLine != null ">and is_down_line = #{isDownLine}</if>
|
||||
<if test="productionCode != null and productionCode != ''">and production_code = #{productionCode}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectMaterialCompletionByObjId" parameterType="Long" resultMap="MaterialCompletionResult">
|
||||
<include refid="selectMaterialCompletionVo"/>
|
||||
where obj_id = #{objId}
|
||||
</select>
|
||||
|
||||
<insert id="insertMaterialCompletion" parameterType="MaterialCompletion">
|
||||
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
|
||||
SELECT seq_material_completion.NEXTVAL as objId FROM DUAL
|
||||
</selectKey>
|
||||
insert into material_completion
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="objId != null">obj_id,</if>
|
||||
<if test="orderCode != null">order_code,</if>
|
||||
<if test="materialBarcode != null">material_barcode,</if>
|
||||
<if test="materialCode != null">material_code,</if>
|
||||
<if test="materialName != null">material_name,</if>
|
||||
<if test="stationName != null">station_name,</if>
|
||||
<if test="completeDate != null">complete_date,</if>
|
||||
<if test="planCode != null">plan_code,</if>
|
||||
<if test="productLineCode != null">product_line_code,</if>
|
||||
<if test="isDownLine != null">is_down_line,</if>
|
||||
<if test="productionCode != null">production_code,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="objId != null">#{objId},</if>
|
||||
<if test="orderCode != null">#{orderCode},</if>
|
||||
<if test="materialBarcode != null">#{materialBarcode},</if>
|
||||
<if test="materialCode != null">#{materialCode},</if>
|
||||
<if test="materialName != null">#{materialName,jdbcType=NVARCHAR},</if>
|
||||
<if test="stationName != null">#{stationName},</if>
|
||||
<if test="completeDate != null">#{completeDate},</if>
|
||||
<if test="planCode != null">#{planCode},</if>
|
||||
<if test="productLineCode != null">#{productLineCode},</if>
|
||||
<if test="isDownLine != null">#{isDownLine},</if>
|
||||
<if test="productionCode != null">#{productionCode},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateMaterialCompletion" parameterType="MaterialCompletion">
|
||||
update material_completion
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="orderCode != null">order_code = #{orderCode},</if>
|
||||
<if test="materialBarcode != null">material_barcode = #{materialBarcode},</if>
|
||||
<if test="materialCode != null">material_code = #{materialCode},</if>
|
||||
<if test="materialName != null">material_name = #{materialName},</if>
|
||||
<if test="stationName != null">station_name = #{stationName},</if>
|
||||
<if test="completeDate != null">complete_date = #{completeDate},</if>
|
||||
<if test="planCode != null">plan_code = #{planCode},</if>
|
||||
<if test="productLineCode != null">product_line_code = #{productLineCode},</if>
|
||||
<if test="isDownLine != null">is_down_line = #{isDownLine},</if>
|
||||
<if test="productionCode != null">production_code = #{productionCode},</if>
|
||||
</trim>
|
||||
where obj_id = #{objId}
|
||||
</update>
|
||||
|
||||
<delete id="deleteMaterialCompletionByObjId" parameterType="Long">
|
||||
delete
|
||||
from material_completion
|
||||
where obj_id = #{objId}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteMaterialCompletionByObjIds" parameterType="String">
|
||||
delete from material_completion where obj_id in
|
||||
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||
#{objId}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
||||
Loading…
Reference in New Issue