Merge remote-tracking branch 'origin/master'
commit
186d0d0fa8
@ -0,0 +1,113 @@
|
||||
package com.op.mes.controller;
|
||||
|
||||
import java.util.List;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
|
||||
import com.op.common.core.utils.poi.ExcelUtil;
|
||||
import com.op.common.core.web.controller.BaseController;
|
||||
import com.op.common.core.web.domain.AjaxResult;
|
||||
import com.op.common.core.web.page.TableDataInfo;
|
||||
import com.op.common.log.enums.BusinessType;
|
||||
import com.op.common.security.annotation.RequiresPermissions;
|
||||
import com.op.mes.domain.BaseProductAttached;
|
||||
import com.op.mes.service.IBaseProductAttachedService;
|
||||
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
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.op.common.log.annotation.Log;
|
||||
|
||||
/**
|
||||
* 物料附属信息Controller
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-07-04
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/attached")
|
||||
public class BaseProductAttachedController extends BaseController
|
||||
{
|
||||
@Autowired
|
||||
private IBaseProductAttachedService baseProductAttachedService;
|
||||
|
||||
/**
|
||||
* 查询物料附属信息列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('mes:attached:list')")
|
||||
@RequiresPermissions("mes:attached:list")
|
||||
@GetMapping("/list")
|
||||
public TableDataInfo list(BaseProductAttached baseProductAttached)
|
||||
{
|
||||
startPage();
|
||||
List<BaseProductAttached> list = baseProductAttachedService.selectBaseProductAttachedList(baseProductAttached);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
/**
|
||||
* 导出物料附属信息列表
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('mes:attached:export')")
|
||||
@RequiresPermissions("mes:attached:export")
|
||||
@Log(title = "物料附属信息", businessType = BusinessType.EXPORT)
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, BaseProductAttached baseProductAttached)
|
||||
{
|
||||
List<BaseProductAttached> list = baseProductAttachedService.selectBaseProductAttachedList(baseProductAttached);
|
||||
ExcelUtil<BaseProductAttached> util = new ExcelUtil<BaseProductAttached>(BaseProductAttached.class);
|
||||
util.exportExcel(response, list, "物料附属信息数据");
|
||||
}
|
||||
|
||||
/**
|
||||
* 获取物料附属信息详细信息
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('mes:attached:query')")
|
||||
@RequiresPermissions("mes:attached:query")
|
||||
@GetMapping(value = "/{id}")
|
||||
public AjaxResult getInfo(@PathVariable("id") String id)
|
||||
{
|
||||
return success(baseProductAttachedService.selectBaseProductAttachedById(id));
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物料附属信息
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('mes:attached:add')")
|
||||
@RequiresPermissions("mes:attached:add")
|
||||
@Log(title = "物料附属信息", businessType = BusinessType.INSERT)
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody BaseProductAttached baseProductAttached)
|
||||
{
|
||||
return toAjax(baseProductAttachedService.insertBaseProductAttached(baseProductAttached));
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物料附属信息
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('mes:attached:edit')")
|
||||
@RequiresPermissions("mes:attached:edit")
|
||||
@Log(title = "物料附属信息", businessType = BusinessType.UPDATE)
|
||||
@PutMapping()
|
||||
public AjaxResult edit(@RequestBody BaseProductAttached baseProductAttached)
|
||||
{
|
||||
return toAjax(baseProductAttachedService.updateBaseProductAttached(baseProductAttached));
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物料附属信息
|
||||
*/
|
||||
// @PreAuthorize("@ss.hasPermi('mes:attached:remove')")
|
||||
@RequiresPermissions("mes:attached:remove")
|
||||
@Log(title = "物料附属信息", businessType = BusinessType.DELETE)
|
||||
@DeleteMapping("/{ids}")
|
||||
public AjaxResult remove(@PathVariable String[] ids)
|
||||
{
|
||||
return toAjax(baseProductAttachedService.deleteBaseProductAttachedByIds(ids));
|
||||
}
|
||||
}
|
@ -0,0 +1,62 @@
|
||||
package com.op.mes.mapper;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.op.mes.domain.BaseProductAttached;
|
||||
|
||||
/**
|
||||
* 物料附属信息Mapper接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-07-04
|
||||
*/
|
||||
public interface BaseProductAttachedMapper
|
||||
{
|
||||
/**
|
||||
* 查询物料附属信息
|
||||
*
|
||||
* @param id 物料附属信息主键
|
||||
* @return 物料附属信息
|
||||
*/
|
||||
public BaseProductAttached selectBaseProductAttachedById(String id);
|
||||
|
||||
/**
|
||||
* 查询物料附属信息列表
|
||||
*
|
||||
* @param baseProductAttached 物料附属信息
|
||||
* @return 物料附属信息集合
|
||||
*/
|
||||
public List<BaseProductAttached> selectBaseProductAttachedList(BaseProductAttached baseProductAttached);
|
||||
|
||||
/**
|
||||
* 新增物料附属信息
|
||||
*
|
||||
* @param baseProductAttached 物料附属信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseProductAttached(BaseProductAttached baseProductAttached);
|
||||
|
||||
/**
|
||||
* 修改物料附属信息
|
||||
*
|
||||
* @param baseProductAttached 物料附属信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseProductAttached(BaseProductAttached baseProductAttached);
|
||||
|
||||
/**
|
||||
* 删除物料附属信息
|
||||
*
|
||||
* @param id 物料附属信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseProductAttachedById(String id);
|
||||
|
||||
/**
|
||||
* 批量删除物料附属信息
|
||||
*
|
||||
* @param ids 需要删除的数据主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseProductAttachedByIds(String[] ids);
|
||||
}
|
@ -0,0 +1,64 @@
|
||||
package com.op.mes.service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
|
||||
import com.op.mes.domain.BaseProductAttached;
|
||||
|
||||
|
||||
/**
|
||||
* 物料附属信息Service接口
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-07-04
|
||||
*/
|
||||
public interface IBaseProductAttachedService
|
||||
{
|
||||
/**
|
||||
* 查询物料附属信息
|
||||
*
|
||||
* @param id 物料附属信息主键
|
||||
* @return 物料附属信息
|
||||
*/
|
||||
public BaseProductAttached selectBaseProductAttachedById(String id);
|
||||
|
||||
/**
|
||||
* 查询物料附属信息列表
|
||||
*
|
||||
* @param baseProductAttached 物料附属信息
|
||||
* @return 物料附属信息集合
|
||||
*/
|
||||
public List<BaseProductAttached> selectBaseProductAttachedList(BaseProductAttached baseProductAttached);
|
||||
|
||||
/**
|
||||
* 新增物料附属信息
|
||||
*
|
||||
* @param baseProductAttached 物料附属信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int insertBaseProductAttached(BaseProductAttached baseProductAttached);
|
||||
|
||||
/**
|
||||
* 修改物料附属信息
|
||||
*
|
||||
* @param baseProductAttached 物料附属信息
|
||||
* @return 结果
|
||||
*/
|
||||
public int updateBaseProductAttached(BaseProductAttached baseProductAttached);
|
||||
|
||||
/**
|
||||
* 批量删除物料附属信息
|
||||
*
|
||||
* @param ids 需要删除的物料附属信息主键集合
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseProductAttachedByIds(String[] ids);
|
||||
|
||||
/**
|
||||
* 删除物料附属信息信息
|
||||
*
|
||||
* @param id 物料附属信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
public int deleteBaseProductAttachedById(String id);
|
||||
}
|
@ -0,0 +1,107 @@
|
||||
package com.op.mes.service.impl;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import com.baomidou.dynamic.datasource.annotation.DS;
|
||||
import com.op.common.core.utils.DateUtils;
|
||||
import com.op.common.core.utils.uuid.IdUtils;
|
||||
import com.op.mes.domain.BaseProductAttached;
|
||||
import com.op.mes.mapper.BaseProductAttachedMapper;
|
||||
import com.op.mes.service.IBaseProductAttachedService;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
|
||||
/**
|
||||
* 物料附属信息Service业务层处理
|
||||
*
|
||||
* @author ruoyi
|
||||
* @date 2024-07-04
|
||||
*/
|
||||
@Service
|
||||
public class BaseProductAttachedServiceImpl implements IBaseProductAttachedService
|
||||
{
|
||||
@Autowired
|
||||
private BaseProductAttachedMapper baseProductAttachedMapper;
|
||||
|
||||
/**
|
||||
* 查询物料附属信息
|
||||
*
|
||||
* @param id 物料附属信息主键
|
||||
* @return 物料附属信息
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public BaseProductAttached selectBaseProductAttachedById(String id)
|
||||
{
|
||||
return baseProductAttachedMapper.selectBaseProductAttachedById(id);
|
||||
}
|
||||
|
||||
/**
|
||||
* 查询物料附属信息列表
|
||||
*
|
||||
* @param baseProductAttached 物料附属信息
|
||||
* @return 物料附属信息
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public List<BaseProductAttached> selectBaseProductAttachedList(BaseProductAttached baseProductAttached)
|
||||
{
|
||||
return baseProductAttachedMapper.selectBaseProductAttachedList(baseProductAttached);
|
||||
}
|
||||
|
||||
/**
|
||||
* 新增物料附属信息
|
||||
*
|
||||
* @param baseProductAttached 物料附属信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int insertBaseProductAttached(BaseProductAttached baseProductAttached)
|
||||
{
|
||||
baseProductAttached.setId(IdUtils.fastSimpleUUID());
|
||||
baseProductAttached.setCreateTime(DateUtils.getNowDate());
|
||||
return baseProductAttachedMapper.insertBaseProductAttached(baseProductAttached);
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改物料附属信息
|
||||
*
|
||||
* @param baseProductAttached 物料附属信息
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int updateBaseProductAttached(BaseProductAttached baseProductAttached)
|
||||
{
|
||||
baseProductAttached.setUpdateTime(DateUtils.getNowDate());
|
||||
return baseProductAttachedMapper.updateBaseProductAttached(baseProductAttached);
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除物料附属信息
|
||||
*
|
||||
* @param ids 需要删除的物料附属信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteBaseProductAttachedByIds(String[] ids)
|
||||
{
|
||||
return baseProductAttachedMapper.deleteBaseProductAttachedByIds(ids);
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除物料附属信息信息
|
||||
*
|
||||
* @param id 物料附属信息主键
|
||||
* @return 结果
|
||||
*/
|
||||
@Override
|
||||
@DS("#header.poolName")
|
||||
public int deleteBaseProductAttachedById(String id)
|
||||
{
|
||||
return baseProductAttachedMapper.deleteBaseProductAttachedById(id);
|
||||
}
|
||||
}
|
@ -0,0 +1,142 @@
|
||||
<?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.op.mes.mapper.BaseProductAttachedMapper">
|
||||
|
||||
<resultMap type="BaseProductAttached" id="BaseProductAttachedResult">
|
||||
<result property="id" column="id" />
|
||||
<result property="productCode" column="product_code" />
|
||||
<result property="category" column="category" />
|
||||
<result property="pc" column="pc" />
|
||||
<result property="iei" column="iei" />
|
||||
<result property="manStandar" column="man_standar" />
|
||||
<result property="sprayWay" column="spray_way" />
|
||||
<result property="blankDiameter" column="blank_diameter" />
|
||||
<result property="blankNo" column="blank_no" />
|
||||
<result property="sprayVolume" column="spray_volume" />
|
||||
<result property="liquidNo" column="liquid_no" />
|
||||
<result property="endometrialDosage" column="endometrial_dosage" />
|
||||
<result property="outerFilmDosage" column="outer_film_dosage" />
|
||||
<result property="support" column="support" />
|
||||
<result property="supportNo" column="support_no" />
|
||||
<result property="pvc" column="pvc" />
|
||||
<result property="supportPlate" column="support_plate" />
|
||||
<result property="other" column="other" />
|
||||
<result property="createBy" column="create_by" />
|
||||
</resultMap>
|
||||
|
||||
<sql id="selectBaseProductAttachedVo">
|
||||
select id, product_code, category, pc, iei, man_standar, spray_way, blank_diameter, blank_no, spray_volume, liquid_no, endometrial_dosage, outer_film_dosage, support, support_no, pvc, support_plate, other, create_by from base_product_attached
|
||||
</sql>
|
||||
|
||||
<select id="selectBaseProductAttachedList" parameterType="BaseProductAttached" resultMap="BaseProductAttachedResult">
|
||||
<include refid="selectBaseProductAttachedVo"/>
|
||||
<where>
|
||||
<if test="productCode != null and productCode != ''"> and product_code = #{productCode}</if>
|
||||
<if test="category != null and category != ''"> and category = #{category}</if>
|
||||
<if test="pc != null and pc != ''"> and pc = #{pc}</if>
|
||||
<if test="iei != null "> and iei = #{iei}</if>
|
||||
<if test="manStandar != null "> and man_standar = #{manStandar}</if>
|
||||
<if test="sprayWay != null and sprayWay != ''"> and spray_way = #{sprayWay}</if>
|
||||
<if test="blankDiameter != null "> and blank_diameter = #{blankDiameter}</if>
|
||||
<if test="blankNo != null and blankNo != ''"> and blank_no = #{blankNo}</if>
|
||||
<if test="sprayVolume != null "> and spray_volume = #{sprayVolume}</if>
|
||||
<if test="liquidNo != null and liquidNo != ''"> and liquid_no = #{liquidNo}</if>
|
||||
<if test="endometrialDosage != null "> and endometrial_dosage = #{endometrialDosage}</if>
|
||||
<if test="outerFilmDosage != null "> and outer_film_dosage = #{outerFilmDosage}</if>
|
||||
<if test="support != null "> and support = #{support}</if>
|
||||
<if test="supportNo != null and supportNo != ''"> and support_no = #{supportNo}</if>
|
||||
<if test="pvc != null "> and pvc = #{pvc}</if>
|
||||
<if test="supportPlate != null "> and support_plate = #{supportPlate}</if>
|
||||
<if test="other != null and other != ''"> and other = #{other}</if>
|
||||
</where>
|
||||
</select>
|
||||
|
||||
<select id="selectBaseProductAttachedById" parameterType="String" resultMap="BaseProductAttachedResult">
|
||||
<include refid="selectBaseProductAttachedVo"/>
|
||||
where id = #{id}
|
||||
</select>
|
||||
|
||||
<insert id="insertBaseProductAttached" parameterType="BaseProductAttached">
|
||||
insert into base_product_attached
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">id,</if>
|
||||
<if test="productCode != null">product_code,</if>
|
||||
<if test="category != null">category,</if>
|
||||
<if test="pc != null">pc,</if>
|
||||
<if test="iei != null">iei,</if>
|
||||
<if test="manStandar != null">man_standar,</if>
|
||||
<if test="sprayWay != null">spray_way,</if>
|
||||
<if test="blankDiameter != null">blank_diameter,</if>
|
||||
<if test="blankNo != null">blank_no,</if>
|
||||
<if test="sprayVolume != null">spray_volume,</if>
|
||||
<if test="liquidNo != null">liquid_no,</if>
|
||||
<if test="endometrialDosage != null">endometrial_dosage,</if>
|
||||
<if test="outerFilmDosage != null">outer_film_dosage,</if>
|
||||
<if test="support != null">support,</if>
|
||||
<if test="supportNo != null">support_no,</if>
|
||||
<if test="pvc != null">pvc,</if>
|
||||
<if test="supportPlate != null">support_plate,</if>
|
||||
<if test="other != null">other,</if>
|
||||
<if test="createBy != null">create_by,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="id != null">#{id},</if>
|
||||
<if test="productCode != null">#{productCode},</if>
|
||||
<if test="category != null">#{category},</if>
|
||||
<if test="pc != null">#{pc},</if>
|
||||
<if test="iei != null">#{iei},</if>
|
||||
<if test="manStandar != null">#{manStandar},</if>
|
||||
<if test="sprayWay != null">#{sprayWay},</if>
|
||||
<if test="blankDiameter != null">#{blankDiameter},</if>
|
||||
<if test="blankNo != null">#{blankNo},</if>
|
||||
<if test="sprayVolume != null">#{sprayVolume},</if>
|
||||
<if test="liquidNo != null">#{liquidNo},</if>
|
||||
<if test="endometrialDosage != null">#{endometrialDosage},</if>
|
||||
<if test="outerFilmDosage != null">#{outerFilmDosage},</if>
|
||||
<if test="support != null">#{support},</if>
|
||||
<if test="supportNo != null">#{supportNo},</if>
|
||||
<if test="pvc != null">#{pvc},</if>
|
||||
<if test="supportPlate != null">#{supportPlate},</if>
|
||||
<if test="other != null">#{other},</if>
|
||||
<if test="createBy != null">#{createBy},</if>
|
||||
</trim>
|
||||
</insert>
|
||||
|
||||
<update id="updateBaseProductAttached" parameterType="BaseProductAttached">
|
||||
update base_product_attached
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="productCode != null">product_code = #{productCode},</if>
|
||||
<if test="category != null">category = #{category},</if>
|
||||
<if test="pc != null">pc = #{pc},</if>
|
||||
<if test="iei != null">iei = #{iei},</if>
|
||||
<if test="manStandar != null">man_standar = #{manStandar},</if>
|
||||
<if test="sprayWay != null">spray_way = #{sprayWay},</if>
|
||||
<if test="blankDiameter != null">blank_diameter = #{blankDiameter},</if>
|
||||
<if test="blankNo != null">blank_no = #{blankNo},</if>
|
||||
<if test="sprayVolume != null">spray_volume = #{sprayVolume},</if>
|
||||
<if test="liquidNo != null">liquid_no = #{liquidNo},</if>
|
||||
<if test="endometrialDosage != null">endometrial_dosage = #{endometrialDosage},</if>
|
||||
<if test="outerFilmDosage != null">outer_film_dosage = #{outerFilmDosage},</if>
|
||||
<if test="support != null">support = #{support},</if>
|
||||
<if test="supportNo != null">support_no = #{supportNo},</if>
|
||||
<if test="pvc != null">pvc = #{pvc},</if>
|
||||
<if test="supportPlate != null">support_plate = #{supportPlate},</if>
|
||||
<if test="other != null">other = #{other},</if>
|
||||
<if test="createBy != null">create_by = #{createBy},</if>
|
||||
</trim>
|
||||
where id = #{id}
|
||||
</update>
|
||||
|
||||
<delete id="deleteBaseProductAttachedById" parameterType="String">
|
||||
delete from base_product_attached where id = #{id}
|
||||
</delete>
|
||||
|
||||
<delete id="deleteBaseProductAttachedByIds" parameterType="String">
|
||||
delete from base_product_attached where id in
|
||||
<foreach item="id" collection="array" open="(" separator="," close=")">
|
||||
#{id}
|
||||
</foreach>
|
||||
</delete>
|
||||
</mapper>
|
Loading…
Reference in New Issue