Merge remote-tracking branch 'origin/master'
This commit is contained in:
commit
ec19fd427d
|
|
@ -55,7 +55,7 @@ public class KitchenDeviceSensorMetricController extends BaseController {
|
|||
@ApiOperation(value = "导出厨房设备衡量指标设置列表")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("kitchen:metric:export")
|
||||
@SysLog(title = "厨房设备衡量指标设置", businessType = OperaType.EXPORT, logType = 1,module = "仓储管理->导出厨房设备衡量指标设置")
|
||||
@SysLog(title = "厨房设备衡量指标设置", businessType = OperaType.EXPORT, logType = 1,module = "厨房管理->导出厨房设备衡量指标设置")
|
||||
@PostMapping("/export")
|
||||
public void export(HttpServletResponse response, KitchenDeviceSensorMetric kitchenDeviceSensorMetric) {
|
||||
List<KitchenDeviceSensorMetric> list = kitchenDeviceSensorMetricService.selectKitchenDeviceSensorMetricList(kitchenDeviceSensorMetric);
|
||||
|
|
@ -79,7 +79,7 @@ public class KitchenDeviceSensorMetricController extends BaseController {
|
|||
@ApiOperation(value = "新增厨房设备衡量指标设置")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("kitchen:metric:add")
|
||||
@SysLog(title = "厨房设备衡量指标设置", businessType = OperaType.INSERT, logType = 1,module = "仓储管理->新增厨房设备衡量指标设置")
|
||||
@SysLog(title = "厨房设备衡量指标设置", businessType = OperaType.INSERT, logType = 1,module = "厨房管理->新增厨房设备衡量指标设置")
|
||||
@PostMapping
|
||||
public AjaxResult add(@RequestBody KitchenDeviceSensorMetric kitchenDeviceSensorMetric) {
|
||||
try {
|
||||
|
|
@ -89,13 +89,26 @@ public class KitchenDeviceSensorMetricController extends BaseController {
|
|||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量新增厨房设备衡量指标设置")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("kitchen:metric:add")
|
||||
@SysLog(title = "厨房设备衡量指标设置", businessType = OperaType.INSERT, logType = 1,module = "厨房管理->批量新增厨房设备衡量指标设置")
|
||||
@PostMapping("/batchAdd")
|
||||
public AjaxResult batchAdd(@RequestBody List<KitchenDeviceSensorMetric> list) {
|
||||
try {
|
||||
return toAjax(kitchenDeviceSensorMetricService.batchInsertKitchenDeviceSensorMetric(list));
|
||||
} catch (Exception e) {
|
||||
return error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改厨房设备衡量指标设置
|
||||
*/
|
||||
@ApiOperation(value = "修改厨房设备衡量指标设置")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("kitchen:metric:edit")
|
||||
@SysLog(title = "厨房设备衡量指标设置", businessType = OperaType.UPDATE, logType = 1,module = "仓储管理->修改厨房设备衡量指标设置")
|
||||
@SysLog(title = "厨房设备衡量指标设置", businessType = OperaType.UPDATE, logType = 1,module = "厨房管理->修改厨房设备衡量指标设置")
|
||||
@PostMapping("/edit")
|
||||
public AjaxResult edit(@RequestBody KitchenDeviceSensorMetric kitchenDeviceSensorMetric) {
|
||||
try {
|
||||
|
|
@ -105,13 +118,26 @@ public class KitchenDeviceSensorMetricController extends BaseController {
|
|||
}
|
||||
}
|
||||
|
||||
@ApiOperation(value = "批量修改厨房设备衡量指标设置")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("kitchen:metric:edit")
|
||||
@SysLog(title = "厨房设备衡量指标设置", businessType = OperaType.UPDATE, logType = 1,module = "厨房管理->批量修改厨房设备衡量指标设置")
|
||||
@PostMapping("/batchEdit")
|
||||
public AjaxResult batchEdit(@RequestBody List<KitchenDeviceSensorMetric> list) {
|
||||
try {
|
||||
return toAjax(kitchenDeviceSensorMetricService.batchUpdateKitchenDeviceSensorMetric(list));
|
||||
} catch (Exception e) {
|
||||
return error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除厨房设备衡量指标设置
|
||||
*/
|
||||
@ApiOperation(value = "删除厨房设备衡量指标设置")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("kitchen:metric:remove")
|
||||
@SysLog(title = "厨房设备衡量指标设置", businessType = OperaType.DELETE, logType = 1,module = "仓储管理->删除厨房设备衡量指标设置")
|
||||
@SysLog(title = "厨房设备衡量指标设置", businessType = OperaType.DELETE, logType = 1,module = "厨房管理->删除厨房设备衡量指标设置")
|
||||
@PostMapping("/del/{measureIds}")
|
||||
public AjaxResult remove(@PathVariable Long[] measureIds) {
|
||||
return toAjax(kitchenDeviceSensorMetricService.deleteKitchenDeviceSensorMetricByMeasureIds(measureIds));
|
||||
|
|
|
|||
|
|
@ -23,15 +23,15 @@ public class KitchenDeviceSensorMetric extends BaseEntity {
|
|||
/** 主键ID */
|
||||
private Long measureId;
|
||||
|
||||
/** 参数名称 */
|
||||
@Excel(name = "参数名称")
|
||||
@ApiModelProperty(value = "参数代码")
|
||||
private String measureCode;
|
||||
/** 设备类型 */
|
||||
@Excel(name = "设备类型")
|
||||
@ApiModelProperty(value = "设备类型")
|
||||
private Long deviceType;
|
||||
|
||||
/** 参数名称 */
|
||||
@Excel(name = "参数名称")
|
||||
@ApiModelProperty(value = "参数代码")
|
||||
private String deviceType;
|
||||
/** 参数编码 */
|
||||
@Excel(name = "参数编码")
|
||||
@ApiModelProperty(value = "参数编码")
|
||||
private String measureCode;
|
||||
|
||||
/** 参数名称 */
|
||||
@Excel(name = "参数名称")
|
||||
|
|
|
|||
|
|
@ -34,6 +34,8 @@ public interface IKitchenDeviceSensorMetricService {
|
|||
*/
|
||||
public int insertKitchenDeviceSensorMetric(KitchenDeviceSensorMetric kitchenDeviceSensorMetric);
|
||||
|
||||
public int batchInsertKitchenDeviceSensorMetric(List<KitchenDeviceSensorMetric> kitchenDeviceSensorMetric);
|
||||
|
||||
/**
|
||||
* 修改厨房设备衡量指标设置
|
||||
*
|
||||
|
|
@ -42,6 +44,8 @@ public interface IKitchenDeviceSensorMetricService {
|
|||
*/
|
||||
public int updateKitchenDeviceSensorMetric(KitchenDeviceSensorMetric kitchenDeviceSensorMetric);
|
||||
|
||||
public int batchUpdateKitchenDeviceSensorMetric(List<KitchenDeviceSensorMetric> list);
|
||||
|
||||
/**
|
||||
* 批量删除厨房设备衡量指标设置
|
||||
*
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@ package com.bonus.canteen.core.kitchen.service.impl;
|
|||
import java.util.List;
|
||||
import com.bonus.common.core.exception.ServiceException;
|
||||
import com.bonus.common.core.utils.DateUtils;
|
||||
import com.bonus.common.security.utils.SecurityUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import com.bonus.canteen.core.kitchen.mapper.KitchenDeviceSensorMetricMapper;
|
||||
|
|
@ -51,6 +52,7 @@ public class KitchenDeviceSensorMetricServiceImpl implements IKitchenDeviceSenso
|
|||
@Override
|
||||
public int insertKitchenDeviceSensorMetric(KitchenDeviceSensorMetric kitchenDeviceSensorMetric) {
|
||||
kitchenDeviceSensorMetric.setCreateTime(DateUtils.getNowDate());
|
||||
kitchenDeviceSensorMetric.setCreateBy(SecurityUtils.getUsername());
|
||||
try {
|
||||
return kitchenDeviceSensorMetricMapper.insertKitchenDeviceSensorMetric(kitchenDeviceSensorMetric);
|
||||
} catch (Exception e) {
|
||||
|
|
@ -58,6 +60,21 @@ public class KitchenDeviceSensorMetricServiceImpl implements IKitchenDeviceSenso
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchInsertKitchenDeviceSensorMetric(List<KitchenDeviceSensorMetric> list) {
|
||||
try {
|
||||
int count = 0;
|
||||
for (KitchenDeviceSensorMetric metric : list) {
|
||||
metric.setCreateTime(DateUtils.getNowDate());
|
||||
metric.setCreateBy(SecurityUtils.getUsername());
|
||||
count += kitchenDeviceSensorMetricMapper.insertKitchenDeviceSensorMetric(metric);
|
||||
}
|
||||
return count;
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 修改厨房设备衡量指标设置
|
||||
*
|
||||
|
|
@ -67,6 +84,7 @@ public class KitchenDeviceSensorMetricServiceImpl implements IKitchenDeviceSenso
|
|||
@Override
|
||||
public int updateKitchenDeviceSensorMetric(KitchenDeviceSensorMetric kitchenDeviceSensorMetric) {
|
||||
kitchenDeviceSensorMetric.setUpdateTime(DateUtils.getNowDate());
|
||||
kitchenDeviceSensorMetric.setUpdateBy(SecurityUtils.getUsername());
|
||||
try {
|
||||
return kitchenDeviceSensorMetricMapper.updateKitchenDeviceSensorMetric(kitchenDeviceSensorMetric);
|
||||
} catch (Exception e) {
|
||||
|
|
@ -74,6 +92,21 @@ public class KitchenDeviceSensorMetricServiceImpl implements IKitchenDeviceSenso
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchUpdateKitchenDeviceSensorMetric(List<KitchenDeviceSensorMetric> list) {
|
||||
try {
|
||||
int count = 0;
|
||||
for (KitchenDeviceSensorMetric metric : list) {
|
||||
metric.setUpdateTime(DateUtils.getNowDate());
|
||||
metric.setUpdateBy(SecurityUtils.getUsername());
|
||||
count += kitchenDeviceSensorMetricMapper.updateKitchenDeviceSensorMetric(metric);
|
||||
}
|
||||
return count;
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除厨房设备衡量指标设置
|
||||
*
|
||||
|
|
|
|||
|
|
@ -5,8 +5,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<mapper namespace="com.bonus.canteen.core.kitchen.mapper.KitchenDeviceSensorMetricMapper">
|
||||
<resultMap type="com.bonus.canteen.core.kitchen.domain.KitchenDeviceSensorMetric" id="KitchenDeviceSensorMetricResult">
|
||||
<result property="measureId" column="measure_id" />
|
||||
<result property="measureCode" column="measure_code" />
|
||||
<result property="deviceType" column="device_type" />
|
||||
<result property="measureCode" column="measure_code" />
|
||||
<result property="measureName" column="measure_name" />
|
||||
<result property="measureType" column="measure_type" />
|
||||
<result property="measureUnit" column="measure_unit" />
|
||||
|
|
@ -19,14 +19,17 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectKitchenDeviceSensorMetricVo">
|
||||
select measure_id, measure_code, device_type, measure_name, measure_type, measure_unit, measure_min_value, measure_max_value, create_by, create_time, update_by, update_time from kitchen_device_sensor_metric
|
||||
select measure_id, device_type, measure_code, measure_name, measure_type, measure_unit,
|
||||
measure_min_value, measure_max_value, create_by, create_time, update_by, update_time
|
||||
from kitchen_device_sensor_metric
|
||||
</sql>
|
||||
|
||||
<select id="selectKitchenDeviceSensorMetricList" parameterType="com.bonus.canteen.core.kitchen.domain.KitchenDeviceSensorMetric" resultMap="KitchenDeviceSensorMetricResult">
|
||||
<include refid="selectKitchenDeviceSensorMetricVo"/>
|
||||
<where>
|
||||
<where>
|
||||
<if test="deviceType != null and deviceType != ''"> and device_type = #{deviceType}</if>
|
||||
<if test="measureCode != null and measureCode != ''"> and measure_code like concat('%', #{measureCode}, '%')</if>
|
||||
<if test="measureName != null and measureName != ''"> and measure_name like concat('%', #{measureName}, '%')</if>
|
||||
<if test="measureCode != null and measureCode != ''"> and measure_code = #{measureCode}</if>
|
||||
<if test="measureType != null and measureType != ''"> and measure_type = #{measureType}</if>
|
||||
<if test="measureUnit != null and measureUnit != ''"> and measure_unit = #{measureUnit}</if>
|
||||
<if test="measureMinValue != null "> and measure_min_value = #{measureMinValue}</if>
|
||||
|
|
@ -43,10 +46,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<include refid="selectKitchenDeviceSensorMetricVo"/>
|
||||
where measure_code = #{measureCode}
|
||||
</select>
|
||||
|
||||
|
||||
<insert id="insertKitchenDeviceSensorMetric" parameterType="com.bonus.canteen.core.kitchen.domain.KitchenDeviceSensorMetric" useGeneratedKeys="true" keyProperty="measureId">
|
||||
insert into kitchen_device_sensor_metric
|
||||
<trim prefix="(" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceType != null">device_type,</if>
|
||||
<if test="measureCode != null">measure_code,</if>
|
||||
<if test="measureName != null">measure_name,</if>
|
||||
<if test="measureType != null">measure_type,</if>
|
||||
|
|
@ -59,6 +63,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="updateTime != null">update_time,</if>
|
||||
</trim>
|
||||
<trim prefix="values (" suffix=")" suffixOverrides=",">
|
||||
<if test="deviceType != null">#{deviceType},</if>
|
||||
<if test="measureCode != null">#{measureCode},</if>
|
||||
<if test="measureName != null">#{measureName},</if>
|
||||
<if test="measureType != null">#{measureType},</if>
|
||||
|
|
@ -75,6 +80,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<update id="updateKitchenDeviceSensorMetric" parameterType="com.bonus.canteen.core.kitchen.domain.KitchenDeviceSensorMetric">
|
||||
update kitchen_device_sensor_metric
|
||||
<trim prefix="SET" suffixOverrides=",">
|
||||
<if test="deviceType != null">device_type = #{deviceType},</if>
|
||||
<if test="measureCode != null">measure_code = #{measureCode},</if>
|
||||
<if test="measureName != null">measure_name = #{measureName},</if>
|
||||
<if test="measureType != null">measure_type = #{measureType},</if>
|
||||
|
|
|
|||
Loading…
Reference in New Issue