diff --git a/src/main/java/com/zcloud/controller/mkmj/MkmjGateLogController.java b/src/main/java/com/zcloud/controller/mkmj/MkmjGateLogController.java new file mode 100644 index 00000000..9fa7455d --- /dev/null +++ b/src/main/java/com/zcloud/controller/mkmj/MkmjGateLogController.java @@ -0,0 +1,122 @@ +package com.zcloud.controller.mkmj; + +import com.zcloud.controller.base.BaseController; +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.service.map.util.ReturnMap; +import com.zcloud.service.mkmj.MkmjAreaGateService; +import com.zcloud.service.mkmj.MkmjGateLogService; +import com.zcloud.util.DateUtil; +import com.zcloud.util.Jurisdiction; +import com.zcloud.util.Tools; +import org.apache.shiro.authz.annotation.RequiresPermissions; +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; + +import java.util.Date; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * 说明:门口门禁区域 + * 作者:zhaoyu + * 时间:2024-01-16 + * 官网:www.zcloudchina.com + */ +@Controller +@RequestMapping("/mkmjAreaGate") +public class MkmjGateLogController extends BaseController { + + @Autowired + private MkmjGateLogService mkmjGateLogService; + + /**新增 + * @param + * @throws Exception + */ + @RequestMapping(value="/add") + @RequiresPermissions("mkmjAreaGate:add") + @ResponseBody + public ReturnMap add() throws Exception{ + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("CREATOR", Jurisdiction.getUSER_ID()); // 添加人 + pd.put("CREATTIME", DateUtil.date2Str(new Date())); // 添加时间 + pd.put("ISDELETE", "0"); //是否删除 + pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人 + pd.put("OPERATTIME", DateUtil.date2Str(new Date()));//修改时间 + return mkmjGateLogService.save(pd); + } + + /**删除 + * @param + * @throws Exception + */ + @RequestMapping(value="/delete") + @RequiresPermissions("mkmjAreaGate:del") + @ResponseBody + public ReturnMap delete() throws Exception{ + PageData pd = new PageData(); + pd = this.getPageData(); + return mkmjGateLogService.delete(pd); + } + + /**修改 + * @param + * @throws Exception + */ + @RequestMapping(value="/edit") + @RequiresPermissions("mkmjAreaGate:edit") + @ResponseBody + public ReturnMap edit() throws Exception{ + PageData pd = new PageData(); + pd = this.getPageData(); + pd.put("OPERATOR", Jurisdiction.getUsername()); //修改人 + pd.put("OPERATTIME", DateUtil.date2Str(new Date()));//修改时间 + return mkmjGateLogService.edit(pd); + } + + /**列表 + * @param page + * @throws Exception + */ + @RequestMapping(value="/list") + @RequiresPermissions("mkmjAreaGate:list") + @ResponseBody + public Object list(Page page) throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + String KEYWORDS = pd.getString("KEYWORDS"); //关键词检索条件 + if(Tools.notEmpty(KEYWORDS))pd.put("KEYWORDS", KEYWORDS.trim()); + page.setPd(pd); + List varList = mkmjGateLogService.list(page); //列出Coursectk列表 + map.put("varList", varList); + map.put("page", page); + map.put("result", errInfo); + return map; + } + + /**去修改页面获取数据 + * @param + * @throws Exception + */ + @RequestMapping(value="/goEdit") + @RequiresPermissions("mkmjAreaGate:edit") + @ResponseBody + public Object goEdit() throws Exception{ + Map map = new HashMap(); + String errInfo = "success"; + PageData pd = new PageData(); + pd = this.getPageData(); + pd = mkmjGateLogService.findById(pd); //根据ID读取 + map.put("pd", pd); + map.put("result", errInfo); + return map; + } + +} diff --git a/src/main/java/com/zcloud/service/mkmj/MkmjGateLogService.java b/src/main/java/com/zcloud/service/mkmj/MkmjGateLogService.java new file mode 100644 index 00000000..a5146ec5 --- /dev/null +++ b/src/main/java/com/zcloud/service/mkmj/MkmjGateLogService.java @@ -0,0 +1,60 @@ +package com.zcloud.service.mkmj; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.service.map.util.ReturnMap; + +import java.util.List; + +/** + * 说明:门口门禁区域闸机 + * 作者:zhaoyu + * 时间:2024-01-16 + * 官网:www.zcloudchina.com + */ +public interface MkmjGateLogService { + + /**新增 + * @param pd + * @throws Exception + */ + public ReturnMap save(PageData pd)throws Exception; + + /**删除 + * @param pd + * @throws Exception + */ + public ReturnMap delete(PageData pd)throws Exception; + + /**修改 + * @param pd + * @throws Exception + */ + public ReturnMap edit(PageData pd)throws Exception; + + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception; + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAll(PageData pd)throws Exception; + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception; + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + public ReturnMap deleteAll(String[] ArrayDATA_IDS)throws Exception; + +} + diff --git a/src/main/java/com/zcloud/service/mkmj/impl/MkmjGateLogServiceImpl.java b/src/main/java/com/zcloud/service/mkmj/impl/MkmjGateLogServiceImpl.java new file mode 100644 index 00000000..a71bbade --- /dev/null +++ b/src/main/java/com/zcloud/service/mkmj/impl/MkmjGateLogServiceImpl.java @@ -0,0 +1,92 @@ +package com.zcloud.service.mkmj.impl; + +import com.zcloud.entity.Page; +import com.zcloud.entity.PageData; +import com.zcloud.mapper.datasource.mkmj.MkmjAreaGateMapper; +import com.zcloud.mapper.datasource.mkmj.MkmjGateLogMapper; +import com.zcloud.service.map.util.ReturnMap; +import com.zcloud.service.mkmj.MkmjAreaGateService; +import com.zcloud.service.mkmj.MkmjGateLogService; +import com.zcloud.util.UuidUtil; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; +import org.springframework.util.ObjectUtils; + +import java.util.List; + +/** + * 说明:门口门禁区域闸机 + * 作者:zhaoyu + * 时间:2024-01-16 + * 官网:www.zcloudchina.com + */ +@Service +@Transactional //开启事物 +public class MkmjGateLogServiceImpl implements MkmjGateLogService { + + @Autowired + private MkmjGateLogMapper mkmjGateLogMapper; + + /**新增 + * @param pd + * @throws Exception + */ + public ReturnMap save(PageData pd)throws Exception{ + mkmjGateLogMapper.save(pd); + return ReturnMap.ok("保存成功"); + } + + /**删除 + * @param pd + * @throws Exception + */ + public ReturnMap delete(PageData pd)throws Exception{ + mkmjGateLogMapper.delete(pd); + return ReturnMap.ok("删除成功"); + } + + /**修改 + * @param pd + * @throws Exception + */ + public ReturnMap edit(PageData pd)throws Exception{ + mkmjGateLogMapper.edit(pd); + return ReturnMap.ok("编辑成功"); + } + + /**列表 + * @param page + * @throws Exception + */ + public List list(Page page)throws Exception{ + return mkmjGateLogMapper.datalistPage(page); + } + + /**列表(全部) + * @param pd + * @throws Exception + */ + public List listAll(PageData pd)throws Exception{ + return mkmjGateLogMapper.listAll(pd); + } + + /**通过id获取数据 + * @param pd + * @throws Exception + */ + public PageData findById(PageData pd)throws Exception{ + return mkmjGateLogMapper.findById(pd); + } + + /**批量删除 + * @param ArrayDATA_IDS + * @throws Exception + */ + public ReturnMap deleteAll(String[] ArrayDATA_IDS)throws Exception{ + mkmjGateLogMapper.deleteAll(ArrayDATA_IDS); + return ReturnMap.ok("删除成功"); + } + +} + diff --git a/src/main/resources/mybatis/datasource/mkmj/MkmjAreaGateMapper.xml b/src/main/resources/mybatis/datasource/mkmj/MkmjAreaGateMapper.xml index 748585af..7632348d 100644 --- a/src/main/resources/mybatis/datasource/mkmj/MkmjAreaGateMapper.xml +++ b/src/main/resources/mybatis/datasource/mkmj/MkmjAreaGateMapper.xml @@ -101,7 +101,7 @@ update set - AREA_GATE_ID= AREA_GATE_ID + AREA_GATE_ID= AREA_GATE_ID, GATE_NUMBER=#{GATE_NUMBER}, AREA_ID=#{AREA_ID}, GATE_NAME=#{GATE_NAME}, @@ -149,6 +149,9 @@ --> ) + + and f.AREA_ID=#{pd.AREA_ID} + diff --git a/src/main/resources/mybatis/datasource/mkmj/MkmjGateLogMapper.xml b/src/main/resources/mybatis/datasource/mkmj/MkmjGateLogMapper.xml new file mode 100644 index 00000000..10dfa80e --- /dev/null +++ b/src/main/resources/mybatis/datasource/mkmj/MkmjGateLogMapper.xml @@ -0,0 +1,175 @@ + + + + + + + MKMJ_GATE_LOG + + + + + SYS_DICTIONARIES + + + + + f.AREA_LOG_ID, + f.AREA_GATE_ID, + f.STATE, + f.LOG_TIME, + f.USER_CARD, + f.GATE_TYPE, + f.CREATOR, + f.CREATTIME, + f.OPERATOR, + f.OPERATTIME, + f.ISDELETE, + f.EX1, + f.EX2, + f.EX3, + f.EX4, + f.EX5 + + + + + AREA_LOG_ID, + AREA_GATE_ID, + STATE, + LOG_TIME, + USER_CARD, + GATE_TYPE, + CREATOR, + CREATTIME, + OPERATOR, + OPERATTIME, + ISDELETE, + EX1, + EX2, + EX3, + EX4, + EX5 + + + + + #{AREA_LOG_ID}, + #{AREA_GATE_ID}, + #{STATE}, + #{LOG_TIME}, + #{USER_CARD}, + #{GATE_TYPE}, + #{CREATOR}, + #{CREATTIME}, + #{OPERATOR}, + #{OPERATTIME}, + #{ISDELETE}, + #{EX1}, + #{EX2}, + #{EX3}, + #{EX4}, + #{EX5} + + + + + insert into + + ( + + ) values ( + + ) + + + + + update + + set + ISDELETE = '1' + where + AREA_LOG_ID = #{AREA_LOG_ID} + + + + + update + + set + AREA_LOG_ID= AREA_LOG_ID, + AREA_GATE_ID=#{AREA_GATE_ID}, + STATE=#{STATE}, + LOG_TIME=#{LOG_TIME}, + USER_CARD=#{USER_CARD}, + GATE_TYPE=#{GATE_TYPE}, + CREATOR=#{CREATOR}, + CREATTIME=#{CREATTIME}, + OPERATOR=#{OPERATOR}, + OPERATTIME=#{OPERATTIME}, + ISDELETE=#{ISDELETE}, + EX1=#{EX1}, + EX2=#{EX2}, + EX3=#{EX3}, + EX4=#{EX4}, + EX5=#{EX5} + where + AREA_LOG_ID=#{AREA_LOG_ID} + + + + + + + + + + + + + + update + + set + ISDELETE = '1' + where + AREA_LOG_ID in + + #{item} + + + +