change - 成品下线异常记录报表
parent
355801cbd7
commit
d3f66e9127
@ -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.RecordException;
|
||||||
|
import com.aucma.report.service.IRecordExceptionService;
|
||||||
|
import com.aucma.common.utils.poi.ExcelUtil;
|
||||||
|
import com.aucma.common.core.page.TableDataInfo;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成品下线异常记录Controller
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-04-01
|
||||||
|
*/
|
||||||
|
@RestController
|
||||||
|
@RequestMapping("/report/recordException")
|
||||||
|
public class RecordExceptionController extends BaseController {
|
||||||
|
@Autowired
|
||||||
|
private IRecordExceptionService recordExceptionService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询成品下线异常记录列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('report:recordException:list')")
|
||||||
|
@GetMapping("/list")
|
||||||
|
public TableDataInfo list(RecordException recordException) {
|
||||||
|
startPage();
|
||||||
|
List<RecordException> list = recordExceptionService.selectRecordExceptionList(recordException);
|
||||||
|
return getDataTable(list);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 导出成品下线异常记录列表
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('report:recordException:export')")
|
||||||
|
@Log(title = "成品下线异常记录", businessType = BusinessType.EXPORT)
|
||||||
|
@PostMapping("/export")
|
||||||
|
public void export(HttpServletResponse response, RecordException recordException) {
|
||||||
|
List<RecordException> list = recordExceptionService.selectRecordExceptionList(recordException);
|
||||||
|
ExcelUtil<RecordException> util = new ExcelUtil<RecordException>(RecordException.class);
|
||||||
|
util.exportExcel(response, list, "成品下线异常记录数据");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 获取成品下线异常记录详细信息
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('report:recordException:query')")
|
||||||
|
@GetMapping(value = "/{objId}")
|
||||||
|
public AjaxResult getInfo(@PathVariable("objId") Long objId) {
|
||||||
|
return success(recordExceptionService.selectRecordExceptionByObjId(objId));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增成品下线异常记录
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('report:recordException:add')")
|
||||||
|
@Log(title = "成品下线异常记录", businessType = BusinessType.INSERT)
|
||||||
|
@PostMapping
|
||||||
|
public AjaxResult add(@RequestBody RecordException recordException) {
|
||||||
|
return toAjax(recordExceptionService.insertRecordException(recordException));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改成品下线异常记录
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('report:recordException:edit')")
|
||||||
|
@Log(title = "成品下线异常记录", businessType = BusinessType.UPDATE)
|
||||||
|
@PutMapping
|
||||||
|
public AjaxResult edit(@RequestBody RecordException recordException) {
|
||||||
|
return toAjax(recordExceptionService.updateRecordException(recordException));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除成品下线异常记录
|
||||||
|
*/
|
||||||
|
@PreAuthorize("@ss.hasPermi('report:recordException:remove')")
|
||||||
|
@Log(title = "成品下线异常记录", businessType = BusinessType.DELETE)
|
||||||
|
@DeleteMapping("/{objIds}")
|
||||||
|
public AjaxResult remove(@PathVariable Long[] objIds) {
|
||||||
|
return toAjax(recordExceptionService.deleteRecordExceptionByObjIds(objIds));
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.aucma.report.mapper;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.aucma.report.domain.RecordException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成品下线异常记录Mapper接口
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-04-01
|
||||||
|
*/
|
||||||
|
public interface RecordExceptionMapper
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询成品下线异常记录
|
||||||
|
*
|
||||||
|
* @param objId 成品下线异常记录主键
|
||||||
|
* @return 成品下线异常记录
|
||||||
|
*/
|
||||||
|
public RecordException selectRecordExceptionByObjId(Long objId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询成品下线异常记录列表
|
||||||
|
*
|
||||||
|
* @param recordException 成品下线异常记录
|
||||||
|
* @return 成品下线异常记录集合
|
||||||
|
*/
|
||||||
|
public List<RecordException> selectRecordExceptionList(RecordException recordException);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增成品下线异常记录
|
||||||
|
*
|
||||||
|
* @param recordException 成品下线异常记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertRecordException(RecordException recordException);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改成品下线异常记录
|
||||||
|
*
|
||||||
|
* @param recordException 成品下线异常记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateRecordException(RecordException recordException);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除成品下线异常记录
|
||||||
|
*
|
||||||
|
* @param objId 成品下线异常记录主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteRecordExceptionByObjId(Long objId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除成品下线异常记录
|
||||||
|
*
|
||||||
|
* @param objIds 需要删除的数据主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteRecordExceptionByObjIds(Long[] objIds);
|
||||||
|
}
|
@ -0,0 +1,61 @@
|
|||||||
|
package com.aucma.report.service;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import com.aucma.report.domain.RecordException;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成品下线异常记录Service接口
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-04-01
|
||||||
|
*/
|
||||||
|
public interface IRecordExceptionService
|
||||||
|
{
|
||||||
|
/**
|
||||||
|
* 查询成品下线异常记录
|
||||||
|
*
|
||||||
|
* @param objId 成品下线异常记录主键
|
||||||
|
* @return 成品下线异常记录
|
||||||
|
*/
|
||||||
|
public RecordException selectRecordExceptionByObjId(Long objId);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询成品下线异常记录列表
|
||||||
|
*
|
||||||
|
* @param recordException 成品下线异常记录
|
||||||
|
* @return 成品下线异常记录集合
|
||||||
|
*/
|
||||||
|
public List<RecordException> selectRecordExceptionList(RecordException recordException);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增成品下线异常记录
|
||||||
|
*
|
||||||
|
* @param recordException 成品下线异常记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int insertRecordException(RecordException recordException);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改成品下线异常记录
|
||||||
|
*
|
||||||
|
* @param recordException 成品下线异常记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int updateRecordException(RecordException recordException);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除成品下线异常记录
|
||||||
|
*
|
||||||
|
* @param objIds 需要删除的成品下线异常记录主键集合
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteRecordExceptionByObjIds(Long[] objIds);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除成品下线异常记录信息
|
||||||
|
*
|
||||||
|
* @param objId 成品下线异常记录主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
public int deleteRecordExceptionByObjId(Long objId);
|
||||||
|
}
|
@ -0,0 +1,87 @@
|
|||||||
|
package com.aucma.report.service.impl;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.springframework.beans.factory.annotation.Autowired;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
import com.aucma.report.mapper.RecordExceptionMapper;
|
||||||
|
import com.aucma.report.domain.RecordException;
|
||||||
|
import com.aucma.report.service.IRecordExceptionService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 成品下线异常记录Service业务层处理
|
||||||
|
*
|
||||||
|
* @author Yinq
|
||||||
|
* @date 2024-04-01
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class RecordExceptionServiceImpl implements IRecordExceptionService {
|
||||||
|
@Autowired
|
||||||
|
private RecordExceptionMapper recordExceptionMapper;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询成品下线异常记录
|
||||||
|
*
|
||||||
|
* @param objId 成品下线异常记录主键
|
||||||
|
* @return 成品下线异常记录
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public RecordException selectRecordExceptionByObjId(Long objId) {
|
||||||
|
return recordExceptionMapper.selectRecordExceptionByObjId(objId);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询成品下线异常记录列表
|
||||||
|
*
|
||||||
|
* @param recordException 成品下线异常记录
|
||||||
|
* @return 成品下线异常记录
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public List<RecordException> selectRecordExceptionList(RecordException recordException) {
|
||||||
|
return recordExceptionMapper.selectRecordExceptionList(recordException);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 新增成品下线异常记录
|
||||||
|
*
|
||||||
|
* @param recordException 成品下线异常记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int insertRecordException(RecordException recordException) {
|
||||||
|
return recordExceptionMapper.insertRecordException(recordException);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 修改成品下线异常记录
|
||||||
|
*
|
||||||
|
* @param recordException 成品下线异常记录
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int updateRecordException(RecordException recordException) {
|
||||||
|
return recordExceptionMapper.updateRecordException(recordException);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 批量删除成品下线异常记录
|
||||||
|
*
|
||||||
|
* @param objIds 需要删除的成品下线异常记录主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteRecordExceptionByObjIds(Long[] objIds) {
|
||||||
|
return recordExceptionMapper.deleteRecordExceptionByObjIds(objIds);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 删除成品下线异常记录信息
|
||||||
|
*
|
||||||
|
* @param objId 成品下线异常记录主键
|
||||||
|
* @return 结果
|
||||||
|
*/
|
||||||
|
@Override
|
||||||
|
public int deleteRecordExceptionByObjId(Long objId) {
|
||||||
|
return recordExceptionMapper.deleteRecordExceptionByObjId(objId);
|
||||||
|
}
|
||||||
|
}
|
@ -0,0 +1,101 @@
|
|||||||
|
<?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.RecordExceptionMapper">
|
||||||
|
|
||||||
|
<resultMap type="RecordException" id="RecordExceptionResult">
|
||||||
|
<result property="objId" column="obj_id"/>
|
||||||
|
<result property="productSncode" column="product_sncode"/>
|
||||||
|
<result property="exceptionMsg" column="exception_msg"/>
|
||||||
|
<result property="productScantime" column="product_scantime"/>
|
||||||
|
<result property="productLineCode" column="product_line_code"/>
|
||||||
|
<result property="exceptionType" column="exception_type"/>
|
||||||
|
<result property="boxCode" column="box_code"/>
|
||||||
|
</resultMap>
|
||||||
|
|
||||||
|
<sql id="selectRecordExceptionVo">
|
||||||
|
select re.obj_id,
|
||||||
|
re.product_sncode,
|
||||||
|
re.exception_msg,
|
||||||
|
re.product_scantime,
|
||||||
|
re.product_line_code,
|
||||||
|
re.exception_type,
|
||||||
|
cb.box_code
|
||||||
|
from C##AUCMA_SCADA.record_exception re
|
||||||
|
left join C##AUCMA_SCADA.CODE_BINDING cb on cb.PRODUCT_CODE = re.product_sncode
|
||||||
|
</sql>
|
||||||
|
|
||||||
|
<select id="selectRecordExceptionList" parameterType="RecordException" resultMap="RecordExceptionResult">
|
||||||
|
<include refid="selectRecordExceptionVo"/>
|
||||||
|
<where>
|
||||||
|
<if test="productSncode != null and productSncode != ''">and re.product_sncode = #{productSncode}</if>
|
||||||
|
<if test="exceptionMsg != null and exceptionMsg != ''">and re.exception_msg = #{exceptionMsg}</if>
|
||||||
|
<if test="params.beginProductScantime != null and params.beginProductScantime != '' and params.endProductScantime != null and params.endProductScantime != ''">
|
||||||
|
and re.product_scantime between to_date(#{params.beginProductScantime}, 'yyyy-mm-dd hh24:mi:ss') and
|
||||||
|
to_date(#{params.endProductScantime}, 'yyyy-mm-dd hh24:mi:ss')
|
||||||
|
</if>
|
||||||
|
<if test="productLineCode != null and productLineCode != ''">and re.product_line_code = #{productLineCode}
|
||||||
|
</if>
|
||||||
|
<if test="boxCode != null and boxCode != ''">and cb.box_code = #{boxCode}</if>
|
||||||
|
<if test="exceptionType != null ">and re.exception_type = #{exceptionType}</if>
|
||||||
|
</where>
|
||||||
|
order by re.product_scantime desc
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<select id="selectRecordExceptionByObjId" parameterType="Long" resultMap="RecordExceptionResult">
|
||||||
|
<include refid="selectRecordExceptionVo"/>
|
||||||
|
where re.obj_id = #{objId}
|
||||||
|
</select>
|
||||||
|
|
||||||
|
<insert id="insertRecordException" parameterType="RecordException">
|
||||||
|
<selectKey keyProperty="objId" resultType="long" order="BEFORE">
|
||||||
|
SELECT seq_record_exception.NEXTVAL as objId FROM DUAL
|
||||||
|
</selectKey>
|
||||||
|
insert into record_exception
|
||||||
|
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="objId != null">obj_id,</if>
|
||||||
|
<if test="productSncode != null">product_sncode,</if>
|
||||||
|
<if test="exceptionMsg != null">exception_msg,</if>
|
||||||
|
<if test="productScantime != null">product_scantime,</if>
|
||||||
|
<if test="productLineCode != null">product_line_code,</if>
|
||||||
|
<if test="exceptionType != null">exception_type,</if>
|
||||||
|
<if test="boxCode != null">box_code,</if>
|
||||||
|
</trim>
|
||||||
|
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||||
|
<if test="objId != null">#{objId},</if>
|
||||||
|
<if test="productSncode != null">#{productSncode},</if>
|
||||||
|
<if test="exceptionMsg != null">#{exceptionMsg},</if>
|
||||||
|
<if test="productScantime != null">#{productScantime},</if>
|
||||||
|
<if test="productLineCode != null">#{productLineCode},</if>
|
||||||
|
<if test="exceptionType != null">#{exceptionType},</if>
|
||||||
|
<if test="boxCode != null">#{boxCode},</if>
|
||||||
|
</trim>
|
||||||
|
</insert>
|
||||||
|
|
||||||
|
<update id="updateRecordException" parameterType="RecordException">
|
||||||
|
update record_exception
|
||||||
|
<trim prefix="SET" suffixOverrides=",">
|
||||||
|
<if test="productSncode != null">product_sncode = #{productSncode},</if>
|
||||||
|
<if test="exceptionMsg != null">exception_msg = #{exceptionMsg},</if>
|
||||||
|
<if test="productScantime != null">product_scantime = #{productScantime},</if>
|
||||||
|
<if test="productLineCode != null">product_line_code = #{productLineCode},</if>
|
||||||
|
<if test="exceptionType != null">exception_type = #{exceptionType},</if>
|
||||||
|
<if test="boxCode != null">box_code = #{boxCode},</if>
|
||||||
|
</trim>
|
||||||
|
where obj_id = #{objId}
|
||||||
|
</update>
|
||||||
|
|
||||||
|
<delete id="deleteRecordExceptionByObjId" parameterType="Long">
|
||||||
|
delete
|
||||||
|
from record_exception
|
||||||
|
where obj_id = #{objId}
|
||||||
|
</delete>
|
||||||
|
|
||||||
|
<delete id="deleteRecordExceptionByObjIds" parameterType="String">
|
||||||
|
delete from record_exception where obj_id in
|
||||||
|
<foreach item="objId" collection="array" open="(" separator="," close=")">
|
||||||
|
#{objId}
|
||||||
|
</foreach>
|
||||||
|
</delete>
|
||||||
|
</mapper>
|
Loading…
Reference in New Issue