供应链设置恢复默认值
This commit is contained in:
parent
8ff83dc450
commit
2f088bfe53
|
|
@ -105,6 +105,22 @@ public class ImsSettingController extends BaseController {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 恢复默认值
|
||||
*/
|
||||
@ApiOperation(value = "恢复默认值")
|
||||
//@PreventRepeatSubmit
|
||||
//@RequiresPermissions("ims:setting:edit")
|
||||
@SysLog(title = "恢复默认值", businessType = OperaType.UPDATE, logType = 1,module = "供应链管理->恢复默认值")
|
||||
@PostMapping("/batchToDefault")
|
||||
public AjaxResult batchToDefault(@RequestBody List<ImsSetting> list) {
|
||||
try {
|
||||
return toAjax(imsSettingService.batchToDefault(list));
|
||||
} catch (Exception e) {
|
||||
return error(e.getMessage());
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 删除厨房功能参数配置
|
||||
*/
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ public interface ImsSettingMapper {
|
|||
*/
|
||||
public int updateImsSetting(ImsSetting imsSetting);
|
||||
|
||||
public int batchToDefault(ImsSetting imsSetting);
|
||||
|
||||
/**
|
||||
* 删除厨房功能参数配置
|
||||
*
|
||||
|
|
|
|||
|
|
@ -42,6 +42,8 @@ public interface IImsSettingService {
|
|||
*/
|
||||
public int updateImsSetting(List<ImsSetting> imsSettings);
|
||||
|
||||
public int batchToDefault(List<ImsSetting> list);
|
||||
|
||||
/**
|
||||
* 批量删除厨房功能参数配置
|
||||
*
|
||||
|
|
|
|||
|
|
@ -84,6 +84,21 @@ public class ImsSettingServiceImpl implements IImsSettingService {
|
|||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public int batchToDefault(List<ImsSetting> list) {
|
||||
int count = 0;
|
||||
for (ImsSetting imsSetting : list) {
|
||||
imsSetting.setUpdateTime(DateUtils.getNowDate());
|
||||
imsSetting.setUpdateBy(SecurityUtils.getUsername());
|
||||
try {
|
||||
count += imsSettingMapper.batchToDefault(imsSetting);
|
||||
} catch (Exception e) {
|
||||
throw new ServiceException(e.getMessage());
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
/**
|
||||
* 批量删除厨房功能参数配置
|
||||
*
|
||||
|
|
|
|||
|
|
@ -72,6 +72,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
where item_name = #{itemName}
|
||||
</update>
|
||||
|
||||
<update id="batchToDefault" parameterType="com.bonus.canteen.core.ims.domain.ImsSetting">
|
||||
update ims_setting
|
||||
set item_value = default_value
|
||||
where item_name = #{itemName}
|
||||
</update>
|
||||
|
||||
<delete id="deleteImsSettingById" parameterType="Long">
|
||||
delete from ims_setting where id = #{id}
|
||||
</delete>
|
||||
|
|
|
|||
Loading…
Reference in New Issue