提交 5122f5d2 编写于 作者: L laijiaping

1、实现表ifs_set_of_books 账套管理-增删改查详情接口

上级 e1ea5621
/*******************************************************************************
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
******************************************************************************/
package com.skyeye.controller;
import com.skyeye.common.object.InputObject;
import com.skyeye.common.object.OutputObject;
import com.skyeye.service.IfsSetOfBooksService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
@Controller
public class IfsSetOfBooksController {
@Autowired
private IfsSetOfBooksService ifsSetOfBooksService;
/**
* @param inputObject
* @param outputObject
* @return void 返回类型
* @throws Exception 参数
* @throws
* @Title: queryIfsSetOfBooksList
* @Description: 获取账套管理列表
*/
@RequestMapping("/post/IfsSetOfBooksController/queryIfsSetOfBooksList")
@ResponseBody
public void queryIfsSetOfBooksList(InputObject inputObject, OutputObject outputObject) throws Exception {
ifsSetOfBooksService.queryIfsSetOfBooksList(inputObject, outputObject);
}
/**
* @param inputObject
* @param outputObject
* @return void 返回类型
* @throws Exception 参数
* @throws
* @Title: insertIfsSetOfBooksMation
* @Description: 新增账套管理信息
*/
@RequestMapping("/post/IfsSetOfBooksController/insertIfsSetOfBooksMation")
@ResponseBody
public void insertIfsSetOfBooksMation(InputObject inputObject, OutputObject outputObject) throws Exception {
ifsSetOfBooksService.insertIfsSetOfBooksMation(inputObject, outputObject);
}
/**
* @param inputObject
* @param outputObject
* @return void 返回类型
* @throws Exception 参数
* @throws
* @Title: deleteIfsSetOfBooksById
* @Description: 删除账套管理信息
*/
@RequestMapping("/post/IfsSetOfBooksController/deleteIfsSetOfBooksById")
@ResponseBody
public void deleteIfsSetOfBooksById(InputObject inputObject, OutputObject outputObject) throws Exception {
ifsSetOfBooksService.deleteIfsSetOfBooksById(inputObject, outputObject);
}
/**
* @param inputObject
* @param outputObject
* @return void 返回类型
* @throws Exception 参数
* @throws
* @Title: selectIfsSetOfBooksById
* @Description: 通过id查找对应的账套管理信息
*/
@RequestMapping("/post/IfsSetOfBooksController/selectIfsSetOfBooksById")
@ResponseBody
public void selectIfsSetOfBooksById(InputObject inputObject, OutputObject outputObject) throws Exception {
ifsSetOfBooksService.selectIfsSetOfBooksById(inputObject, outputObject);
}
/**
* @param inputObject
* @param outputObject
* @return void 返回类型
* @throws Exception 参数
* @throws
* @Title: editIfsSetOfBooksMationById
* @Description: 通过id编辑对应的账套管理信息
*/
@RequestMapping("/post/IfsSetOfBooksController/editIfsSetOfBooksMationById")
@ResponseBody
public void editIfsSetOfBooksMationById(InputObject inputObject, OutputObject outputObject) throws Exception {
ifsSetOfBooksService.editIfsSetOfBooksMationById(inputObject, outputObject);
}
/**
* @param inputObject
* @param outputObject
* @return void 返回类型
* @throws Exception 参数
* @throws
* @Title: selectIfsSetOfBooksMationById
* @Description: 通过id查找对应的账套管理信息详情
*/
@RequestMapping("/post/IfsSetOfBooksController/selectIfsSetOfBooksMationById")
@ResponseBody
public void selectIfsSetOfBooksMationById(InputObject inputObject, OutputObject outputObject) throws Exception {
ifsSetOfBooksService.selectIfsSetOfBooksMationById(inputObject, outputObject);
}
}
/*******************************************************************************
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
******************************************************************************/
package com.skyeye.dao;
import java.util.List;
import java.util.Map;
/**
* @ClassName: IfsSetOfBooksDao
* @Description: 系统编辑器模板数据层
* @author: skyeye云系列
* @date: 2021/11/21 14:03
* @Copyright: 2021 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved.
* 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的
*/
public interface IfsSetOfBooksDao {
public List<Map<String, Object>> queryIfsSetOfBooksByList(Map<String, Object> map) throws Exception;
public Map<String, Object> queryIfsSetOfBooksMationByName(Map<String, Object> map) throws Exception;
public int insertIfsSetOfBooks(Map<String, Object> map) throws Exception;
public int deleteIfsSetOfBooksById(Map<String, Object> map) throws Exception;
public Map<String, Object> queryIfsSetOfBooksDetailById(Map<String, Object> map) throws Exception;
public Map<String, Object> queryIfsSetOfBooksToEditById(Map<String, Object> map) throws Exception;
public int editIfsSetOfBooksById(Map<String, Object> map) throws Exception;
}
/*******************************************************************************
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
******************************************************************************/
package com.skyeye.service;
import com.skyeye.common.object.InputObject;
import com.skyeye.common.object.OutputObject;
public interface IfsSetOfBooksService {
public void queryIfsSetOfBooksList(InputObject inputObject, OutputObject outputObject) throws Exception;
public void insertIfsSetOfBooksMation(InputObject inputObject, OutputObject outputObject) throws Exception;
public void deleteIfsSetOfBooksById(InputObject inputObject, OutputObject outputObject) throws Exception;
public void selectIfsSetOfBooksById(InputObject inputObject, OutputObject outputObject) throws Exception;
public void selectIfsSetOfBooksMationById(InputObject inputObject, OutputObject outputObject) throws Exception;
public void editIfsSetOfBooksMationById(InputObject inputObject, OutputObject outputObject) throws Exception;
}
/*******************************************************************************
* Copyright 卫志强 QQ:598748873@qq.com Inc. All rights reserved. 开源地址:https://gitee.com/doc_wei01/skyeye
******************************************************************************/
package com.skyeye.service.impl;
import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper;
import com.skyeye.common.object.InputObject;
import com.skyeye.common.object.OutputObject;
import com.skyeye.common.util.DateUtil;
import com.skyeye.common.util.ToolUtil;
import com.skyeye.dao.IfsSetOfBooksDao;
import com.skyeye.jedis.JedisClientService;
import com.skyeye.service.IfsSetOfBooksService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.List;
import java.util.Map;
/**
* @ClassName: IfsSetOfBooksServiceImpl
* @Description: 账套管理服务类
* @author: skyeye云系列
* @date: 2021/11/21 14:15
* @Copyright: 2021 https://gitee.com/doc_wei01/skyeye Inc. All rights reserved.
* 注意:本内容仅限购买后使用.禁止私自外泄以及用于其他的商业目的
*/
@Service
public class IfsSetOfBooksServiceImpl implements IfsSetOfBooksService {
@Autowired
private IfsSetOfBooksDao ifsSetOfBooksDao;
/**
* @param inputObject
* @param outputObject
* @return void 返回类型
* @throws Exception 参数
* @throws
* @Title: queryIfsSetOfBooksList
* @Description: 获取账套管理表
*/
@Override
public void queryIfsSetOfBooksList(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
map.put("userId", inputObject.getLogParams().get("id"));
Page pages = PageHelper.startPage(Integer.parseInt(map.get("page").toString()), Integer.parseInt(map.get("limit").toString()));
List<Map<String, Object>> beans = ifsSetOfBooksDao.queryIfsSetOfBooksByList(map);
outputObject.setBeans(beans);
outputObject.settotal(pages.getTotal());
}
/**
* @param inputObject
* @param outputObject
* @return void 返回类型
* @throws Exception 参数
* @throws
* @Title: insertIfsSetOfBooksMation
* @Description: 新增账套管理
*/
@Override
@Transactional(value = "transactionManager")
public void insertIfsSetOfBooksMation(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
map.put("userId", inputObject.getLogParams().get("id"));
Map<String, Object> bean = ifsSetOfBooksDao.queryIfsSetOfBooksMationByName(map);
if (bean != null && !bean.isEmpty()) {
outputObject.setreturnMessage("该账套管理已存在,请更换");
} else {
map.put("id", ToolUtil.getSurFaceId());
map.put("createTime", DateUtil.getTimeAndToString());
ifsSetOfBooksDao.insertIfsSetOfBooks(map);
}
}
/**
* @param inputObject
* @param outputObject
* @return void 返回类型
* @throws Exception 参数
* @throws
* @Title: deleteIfsSetOfBooksById
* @Description: 删除账套管理信息
*/
@Override
@Transactional(value = "transactionManager")
public void deleteIfsSetOfBooksById(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
ifsSetOfBooksDao.deleteIfsSetOfBooksById(map);
}
/**
* @param inputObject
* @param outputObject
* @return void 返回类型
* @throws Exception 参数
* @throws
* @Title: selectIfsSetOfBooksById
* @Description: 通过id查找对应的账套管理信息
*/
@Override
public void selectIfsSetOfBooksById(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
Map<String, Object> bean = ifsSetOfBooksDao.queryIfsSetOfBooksToEditById(map);
outputObject.setBean(bean);
outputObject.settotal(1);
}
/**
* @param inputObject
* @param outputObject
* @return void 返回类型
* @throws Exception 参数
* @throws
* @Title: editIfsSetOfBooksMationById
* @Description: 通过id编辑对应的账套管理信息
*/
@Override
@Transactional(value = "transactionManager")
public void editIfsSetOfBooksMationById(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
map.put("userId", inputObject.getLogParams().get("id"));
Map<String, Object> bean = ifsSetOfBooksDao.queryIfsSetOfBooksMationByName(map);
if (bean != null && !bean.isEmpty()) {
outputObject.setreturnMessage("该账套信息已存在,请更换");
} else {
map.put("lastUpdateTime", DateUtil.getTimeAndToString());
ifsSetOfBooksDao.editIfsSetOfBooksById(map);
}
}
/**
* @param inputObject
* @param outputObject
* @return void 返回类型
* @throws Exception 参数
* @throws
* @Title: selectIfsSetOfBooksMationById
* @Description: 通过id查找对应的账套管理信息详情
*/
@Override
public void selectIfsSetOfBooksMationById(InputObject inputObject, OutputObject outputObject) throws Exception {
Map<String, Object> map = inputObject.getParams();
Map<String, Object> bean = ifsSetOfBooksDao.queryIfsSetOfBooksDetailById(map);
outputObject.setBean(bean);
outputObject.settotal(1);
}
}
<?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.skyeye.dao.IfsSetOfBooksDao">
<select id="queryIfsSetOfBooksByList" parameterType="java.util.Map" resultType="java.util.Map">
SELECT
a.id,
a.name `name`,
CASE a.state WHEN '1' THEN '启用' WHEN '2' THEN '停用' ELSE a.state END state,
CONVERT (a.start_time, CHAR) startTime,
CONVERT (a.end_time, CHAR) endTime,
a.remark
FROM
ifs_set_of_books a
WHERE
1 = 1
<if test="state != '' and state != null">
AND a.state = #{state}
</if>
<if test="name != '' and name != null">
AND a.name LIKE '%${name}%'
</if>
<if test="startTime1 != '' and startTime1 != null and startTime2 != '' and startTime2 != null">
AND a.start_time >= #{startTime1} AND #{startTime2} >= a.start_time
</if>
<if test="endTime1 != '' and endTime1 != null and endTime2 != '' and endTime2 != null">
AND a.end_time >= #{endTime1} AND #{endTime2} >= a.end_time
</if>
ORDER BY a.last_update_time DESC, a.id ASC
</select>
<select id="queryIfsSetOfBooksMationByName" parameterType="java.util.Map" resultType="java.util.Map">
SELECT
a.id
FROM
ifs_set_of_books a
WHERE
a.name = #{name}
<if test="id != '' and id != null">
AND a.id != #{id}
</if>
</select>
<insert id="insertIfsSetOfBooks" parameterType="java.util.Map">
INSERT INTO ifs_set_of_books (id, `name`, state, start_time, end_time, remark, create_id, create_time, last_update_id, last_update_time
) VALUES
(#{id}, #{name}, #{state}, #{startTime}, #{endTime}, #{remark}, #{userId}, #{createTime}, #{userId}, #{createTime})
</insert>
<select id="queryIfsSetOfBooksToEditById" parameterType="java.util.Map" resultType="java.util.Map">
SELECT
a.id,
a.name `name`,
a.state state,
CONVERT (a.start_time, CHAR) startTime,
CONVERT (a.end_time, CHAR) endTime,
a.remark
FROM
ifs_set_of_books a
WHERE
a.id = #{id}
</select>
<update id="editIfsSetOfBooksById" parameterType="java.util.Map">
UPDATE ifs_set_of_books
<set>
`name` = #{name},
state = #{state},
start_time = #{startTime},
end_time = #{endTime},
remark = #{remark},
last_update_id = #{userId},
last_update_time = #{lastUpdateTime}
</set>
WHERE
id = #{id}
</update>
<delete id="deleteIfsSetOfBooksById" parameterType="java.util.Map">
DELETE
FROM
ifs_set_of_books
WHERE
id = #{id}
</delete>
<select id="queryIfsSetOfBooksDetailById" parameterType="java.util.Map" resultType="java.util.Map">
SELECT
a.id,
a.name `name`,
CASE a.state WHEN '1' THEN '启用' WHEN '2' THEN '停用' ELSE a.state END state,
CONVERT (a.start_time, CHAR) startTime,
CONVERT (a.end_time, CHAR) endTime,
a.remark
FROM
ifs_set_of_books a
WHERE
a.id = #{id}
</select>
</mapper>
\ No newline at end of file
......@@ -254,4 +254,41 @@
</url>
<!-- 收预付款管理结束 -->
<!-- 账套管理开始 -->
<url id="ifssetofbooks001" path="/post/IfsSetOfBooksController/queryIfsSetOfBooksList" val="查询账套列表信息" allUse="1" groupName="财务模块">
<property id="name" name="name" ref="" var="账套名称" />
<property id="state" name="state" ref="" var="状态" />
<property id="startTime1" name="startTime1" ref="" var="开始日期范围" />
<property id="startTime2" name="startTime2" ref="" var="开始日期范围" />
<property id="endTime1" name="endTime1" ref="" var="结束日期范围" />
<property id="startTime2" name="endTime2" ref="" var="结束日期范围" />
<property id="limit" name="limit" ref="required,num" var="分页参数,每页多少条数据" />
<property id="page" name="page" ref="required,num" var="分页参数,第几页"/>
</url>
<url id="ifssetofbooks002" path="/post/IfsSetOfBooksController/insertIfsSetOfBooksMation" val="添加账套信息" allUse="1" method="POST" groupName="财务模块">
<property id="name" name="name" ref="required" var="账套名称" />
<property id="state" name="state" ref="required,num" var="状态" />
<property id="startTime" name="startTime" ref="required" var="开始日期" />
<property id="endTime" name="endTime" ref="required" var="结束日期" />
<property id="remark" name="remark" ref="" var="描述" />
</url>
<url id="ifssetofbooks003" path="/post/IfsSetOfBooksController/selectIfsSetOfBooksById" val="查询账套信息用于数据回显" allUse="2" method="GET" groupName="财务模块">
<property id="rowId" name="id" ref="required" var="账套Id"></property>
</url>
<url id="ifssetofbooks004" path="/post/IfsSetOfBooksController/editIfsSetOfBooksMationById" val="编辑账套信息" allUse="1" method="PUT" groupName="财务模块">
<property id="rowId" name="id" ref="required" var="账套Id"></property>
<property id="name" name="name" ref="required" var="账套名称" />
<property id="state" name="state" ref="required,num" var="状态" />
<property id="startTime" name="startTime" ref="required" var="开始日期" />
<property id="endTime" name="endTime" ref="required" var="结束日期" />
<property id="remark" name="remark" ref="" var="描述" />
</url>
<url id="ifssetofbooks005" path="/post/IfsSetOfBooksController/deleteIfsSetOfBooksById" val="删除账套信息" allUse="1" method="DELETE" groupName="财务模块">
<property id="rowId" name="id" ref="required" var="账套Id"></property>
</url>
<url id="ifssetofbooks006" path="/post/IfsSetOfBooksController/selectIfsSetOfBooksMationById" val="查询账套信息详情" method="GET" allUse="1" groupName="财务模块">
<property id="rowId" name="id" ref="required" var="账套Id"></property>
</url>
<!-- 账套管理结束 -->
</controller>
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册