| | |
| | | {} |
| | | { |
| | | "project": 6594, |
| | | "template": { |
| | | "alias": "eva", |
| | | "command": "interface", |
| | | "versionNo": "v2.2.7", |
| | | "option": { |
| | | "resources": "user_action" |
| | | } |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:useraction:create', 'æ°å»ºäººåæä½è®°å½æ¥å¿', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:useraction:delete', 'å é¤äººåæä½è®°å½æ¥å¿', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:useraction:update', 'ä¿®æ¹äººåæä½è®°å½æ¥å¿', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:useraction:query', 'æ¥è¯¢äººåæä½è®°å½æ¥å¿', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:useraction:exportExcel', '导åºäººåæä½è®°å½æ¥å¿(Excel)', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:useraction:create', 'æ°å»ºäººåæä½è®°å½æ¥å¿', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:useraction:delete', 'å é¤äººåæä½è®°å½æ¥å¿', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:useraction:update', 'ä¿®æ¹äººåæä½è®°å½æ¥å¿', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:useraction:query', 'æ¥è¯¢äººåæä½è®°å½æ¥å¿', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | INSERT INTO `SYSTEM_PERMISSION`(`CODE`, `NAME`, `REMARK`, `FIXED`, `CREATE_USER`, `CREATE_TIME`, `UPDATE_USER`, `UPDATE_TIME`, `DELETED`) VALUES ('business:useraction:exportExcel', '导åºäººåæä½è®°å½æ¥å¿(Excel)', '', 0, 1, CURRENT_TIMESTAMP, NULL, NULL, 0); |
| | | |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.dao.business.model.UserAction; |
| | | import com.doumee.service.business.UserActionService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/12/14 13:57 |
| | | */ |
| | | @Api(tags = "人åæä½è®°å½æ¥å¿") |
| | | @RestController |
| | | @RequestMapping("/business/userAction") |
| | | public class UserActionController extends BaseController { |
| | | |
| | | @Autowired |
| | | private UserActionService userActionService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @RequiresPermissions("business:useraction:create") |
| | | public ApiResponse create(@RequestBody UserAction userAction) { |
| | | return ApiResponse.success(userActionService.create(userAction)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @RequiresPermissions("business:useraction:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | userActionService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @RequiresPermissions("business:useraction:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(Integer.valueOf(id)); |
| | | } |
| | | userActionService.deleteByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @RequiresPermissions("business:useraction:update") |
| | | public ApiResponse updateById(@RequestBody UserAction userAction) { |
| | | userActionService.updateById(userAction); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("business:useraction:query") |
| | | public ApiResponse<PageData<UserAction>> findPage (@RequestBody PageWrap<UserAction> pageWrap) { |
| | | return ApiResponse.success(userActionService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @RequiresPermissions("business:useraction:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<UserAction> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(UserAction.class).export(userActionService.findPage(pageWrap).getRecords(), "人åæä½è®°å½æ¥å¿", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @RequiresPermissions("business:useraction:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(userActionService.findById(id)); |
| | | } |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.doumee.dao.business.model.CarEvent; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/11/30 15:33 |
| | | */ |
| | | public interface CarEventMapper extends BaseMapper<CarEvent> { |
| | | |
| | | void insertBatchSomeColumn(List<CarEvent> list); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.doumee.dao.business.model.UserAction; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/12/14 13:57 |
| | | */ |
| | | public interface UserActionMapper extends BaseMapper<UserAction> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.model; |
| | | |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 人åæä½è®°å½æ¥å¿ |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/12/14 13:57 |
| | | */ |
| | | @Data |
| | | @ApiModel("人åæä½è®°å½æ¥å¿") |
| | | @TableName("`user_action`") |
| | | public class UserAction { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | @ApiModelProperty(value = "主é®", example = "1") |
| | | @ExcelColumn(name="主é®") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "å建人ç¼ç ", example = "1") |
| | | @ExcelColumn(name="å建人ç¼ç ") |
| | | private Integer creator; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @ExcelColumn(name="å建æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date createDate; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°äººç¼ç ", example = "1") |
| | | @ExcelColumn(name="æ´æ°äººç¼ç ") |
| | | private Integer editor; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | @ExcelColumn(name="æ´æ°æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date editDate; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦å é¤0å¦ 1æ¯", example = "1") |
| | | @ExcelColumn(name="æ¯å¦å é¤0å¦ 1æ¯") |
| | | private Integer isdeleted; |
| | | |
| | | @ApiModelProperty(value = "夿³¨") |
| | | @ExcelColumn(name="夿³¨") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "ç±»å 0è§£å» 1å»ç» 2æé» 3æ¢å¤ 4设为æè®¿äºº 5åæ¶æè®¿äºº 6设为é«çº§å®¡æ¹äºº 7åæ¶é«çº§å®¡æ¹äºº 8æå¨ç¦»åº 9å é¤", example = "1") |
| | | @ExcelColumn(name="ç±»å 0è§£å» 1å»ç» 2æé» 3æ¢å¤ 4设为æè®¿äºº 5åæ¶æè®¿äºº 6设为é«çº§å®¡æ¹äºº 7åæ¶é«çº§å®¡æ¹äºº 8æå¨ç¦»åº 9å é¤") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "人åæä½è®°å½æ¥å¿") |
| | | @ExcelColumn(name="人åæä½è®°å½æ¥å¿") |
| | | private String memberId; |
| | | |
| | | @ApiModelProperty(value = "æä½åç¶æ 0è§£å» 1å»ç» 2æé» 3æ¢å¤ 4设为æè®¿äºº 5åæ¶æè®¿äºº 6设为é«çº§å®¡æ¹äºº 7åæ¶é«çº§å®¡æ¹äºº 8æå¨ç¦»åº 9å é¤", example = "1") |
| | | @ExcelColumn(name="æä½åç¶æ 0è§£å» 1å»ç» 2æé» 3æ¢å¤ 4设为æè®¿äºº 5åæ¶æè®¿äºº 6设为é«çº§å®¡æ¹äºº 7åæ¶é«çº§å®¡æ¹äºº 8æå¨ç¦»åº 9å é¤") |
| | | private Integer beforeStatus; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.service.business; |
| | | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.UserAction; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 人åæä½è®°å½æ¥å¿Serviceå®ä¹ |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/12/14 13:57 |
| | | */ |
| | | public interface UserActionService { |
| | | |
| | | /** |
| | | * å建 |
| | | * |
| | | * @param userAction å®ä½å¯¹è±¡ |
| | | * @return Integer |
| | | */ |
| | | Integer create(UserAction userAction); |
| | | |
| | | /** |
| | | * 主é®å é¤ |
| | | * |
| | | * @param id ä¸»é® |
| | | */ |
| | | void deleteById(Integer id); |
| | | |
| | | /** |
| | | * å é¤ |
| | | * |
| | | * @param userAction å®ä½å¯¹è±¡ |
| | | */ |
| | | void delete(UserAction userAction); |
| | | |
| | | /** |
| | | * æ¹é主é®å é¤ |
| | | * |
| | | * @param ids 主é®é |
| | | */ |
| | | void deleteByIdInBatch(List<Integer> ids); |
| | | |
| | | /** |
| | | * 䏻鮿´æ° |
| | | * |
| | | * @param userAction å®ä½å¯¹è±¡ |
| | | */ |
| | | void updateById(UserAction userAction); |
| | | |
| | | /** |
| | | * æ¹é䏻鮿´æ° |
| | | * |
| | | * @param userActions å®ä½é |
| | | */ |
| | | void updateByIdInBatch(List<UserAction> userActions); |
| | | |
| | | /** |
| | | * 䏻鮿¥è¯¢ |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return UserAction |
| | | */ |
| | | UserAction findById(Integer id); |
| | | |
| | | /** |
| | | * æ¡ä»¶æ¥è¯¢åæ¡è®°å½ |
| | | * |
| | | * @param userAction å®ä½å¯¹è±¡ |
| | | * @return UserAction |
| | | */ |
| | | UserAction findOne(UserAction userAction); |
| | | |
| | | /** |
| | | * æ¡ä»¶æ¥è¯¢ |
| | | * |
| | | * @param userAction å®ä½å¯¹è±¡ |
| | | * @return List<UserAction> |
| | | */ |
| | | List<UserAction> findList(UserAction userAction); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param pageWrap å页对象 |
| | | * @return PageData<UserAction> |
| | | */ |
| | | PageData<UserAction> findPage(PageWrap<UserAction> pageWrap); |
| | | |
| | | /** |
| | | * æ¡ä»¶ç»è®¡ |
| | | * |
| | | * @param userAction å®ä½å¯¹è±¡ |
| | | * @return long |
| | | */ |
| | | long count(UserAction userAction); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.UserActionMapper; |
| | | import com.doumee.dao.business.model.UserAction; |
| | | import com.doumee.service.business.UserActionService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 人åæä½è®°å½æ¥å¿Serviceå®ç° |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/12/14 13:57 |
| | | */ |
| | | @Service |
| | | public class UserActionServiceImpl implements UserActionService { |
| | | |
| | | @Autowired |
| | | private UserActionMapper userActionMapper; |
| | | |
| | | @Override |
| | | public Integer create(UserAction userAction) { |
| | | userActionMapper.insert(userAction); |
| | | return userAction.getId(); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteById(Integer id) { |
| | | userActionMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(UserAction userAction) { |
| | | UpdateWrapper<UserAction> deleteWrapper = new UpdateWrapper<>(userAction); |
| | | userActionMapper.delete(deleteWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteByIdInBatch(List<Integer> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | return; |
| | | } |
| | | userActionMapper.deleteBatchIds(ids); |
| | | } |
| | | |
| | | @Override |
| | | public void updateById(UserAction userAction) { |
| | | userActionMapper.updateById(userAction); |
| | | } |
| | | |
| | | @Override |
| | | public void updateByIdInBatch(List<UserAction> userActions) { |
| | | if (CollectionUtils.isEmpty(userActions)) { |
| | | return; |
| | | } |
| | | for (UserAction userAction: userActions) { |
| | | this.updateById(userAction); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public UserAction findById(Integer id) { |
| | | return userActionMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public UserAction findOne(UserAction userAction) { |
| | | QueryWrapper<UserAction> wrapper = new QueryWrapper<>(userAction); |
| | | return userActionMapper.selectOne(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<UserAction> findList(UserAction userAction) { |
| | | QueryWrapper<UserAction> wrapper = new QueryWrapper<>(userAction); |
| | | return userActionMapper.selectList(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public PageData<UserAction> findPage(PageWrap<UserAction> pageWrap) { |
| | | IPage<UserAction> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | QueryWrapper<UserAction> queryWrapper = new QueryWrapper<>(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | if (pageWrap.getModel().getId() != null) { |
| | | queryWrapper.lambda().eq(UserAction::getId, pageWrap.getModel().getId()); |
| | | } |
| | | if (pageWrap.getModel().getCreator() != null) { |
| | | queryWrapper.lambda().eq(UserAction::getCreator, pageWrap.getModel().getCreator()); |
| | | } |
| | | if (pageWrap.getModel().getCreateDate() != null) { |
| | | queryWrapper.lambda().ge(UserAction::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate())); |
| | | queryWrapper.lambda().le(UserAction::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateDate())); |
| | | } |
| | | if (pageWrap.getModel().getEditor() != null) { |
| | | queryWrapper.lambda().eq(UserAction::getEditor, pageWrap.getModel().getEditor()); |
| | | } |
| | | if (pageWrap.getModel().getEditDate() != null) { |
| | | queryWrapper.lambda().ge(UserAction::getEditDate, Utils.Date.getStart(pageWrap.getModel().getEditDate())); |
| | | queryWrapper.lambda().le(UserAction::getEditDate, Utils.Date.getEnd(pageWrap.getModel().getEditDate())); |
| | | } |
| | | if (pageWrap.getModel().getIsdeleted() != null) { |
| | | queryWrapper.lambda().eq(UserAction::getIsdeleted, pageWrap.getModel().getIsdeleted()); |
| | | } |
| | | if (pageWrap.getModel().getRemark() != null) { |
| | | queryWrapper.lambda().eq(UserAction::getRemark, pageWrap.getModel().getRemark()); |
| | | } |
| | | if (pageWrap.getModel().getType() != null) { |
| | | queryWrapper.lambda().eq(UserAction::getType, pageWrap.getModel().getType()); |
| | | } |
| | | if (pageWrap.getModel().getMemberId() != null) { |
| | | queryWrapper.lambda().eq(UserAction::getMemberId, pageWrap.getModel().getMemberId()); |
| | | } |
| | | if (pageWrap.getModel().getBeforeStatus() != null) { |
| | | queryWrapper.lambda().eq(UserAction::getBeforeStatus, pageWrap.getModel().getBeforeStatus()); |
| | | } |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | | queryWrapper.orderByDesc(sortData.getProperty()); |
| | | } else { |
| | | queryWrapper.orderByAsc(sortData.getProperty()); |
| | | } |
| | | } |
| | | return PageData.from(userActionMapper.selectPage(page, queryWrapper)); |
| | | } |
| | | |
| | | @Override |
| | | public long count(UserAction userAction) { |
| | | QueryWrapper<UserAction> wrapper = new QueryWrapper<>(userAction); |
| | | return userActionMapper.selectCount(wrapper); |
| | | } |
| | | } |
| | |
| | | import com.doumee.core.haikang.model.param.request.event.acs.EventAcsInfoRequest; |
| | | import com.doumee.core.haikang.model.param.request.event.acs.EventAcsRequest; |
| | | import com.doumee.core.haikang.model.param.request.event.acs.EventDeviceDataRequest; |
| | | import com.doumee.core.haikang.model.param.request.event.parks.EventParkInfoRequest; |
| | | import com.doumee.core.haikang.model.param.request.event.parks.EventParkRequest; |
| | | import com.doumee.core.haikang.model.param.request.event.visit.EventVisitDataRequest; |
| | | import com.doumee.core.haikang.model.param.request.event.visit.EventVisitInfoRequest; |
| | |
| | | String result = null; |
| | | log.info("ãæµ·åº·å车åºäºä»¶æ¨éã========å¼å§=========ï¼\n"+JSONObject.toJSONString(param)); |
| | | try { |
| | | |
| | | if(param == null || param.getParams() == null || param.getParams().getEvents()==null){ |
| | | return null; |
| | | } |
| | | //é¨ç¦äºä»¶éå |
| | | List<EventParkInfoRequest> events = param.getParams().getEvents(); |
| | | List<CarEvent> list = new ArrayList<>(); |
| | | for(EventParkInfoRequest request : events){ |
| | | if(request.getData() ==null ||StringUtils.isBlank(request.getData().getPlateNo())){ |
| | | continue; |
| | | } |
| | | //å°è£
äºä»¶ä¿¡æ¯è¡¨å¯¹è±¡ |
| | | list.add(getParkEventModelByRequest(request)); |
| | | } |
| | | if(list.size()>0){ |
| | | //æå
¥é¨ç¦è®°å½ |
| | | carEventMapper.insertBatchSomeColumn(list); |
| | | } |
| | | log.error("ãæµ·åº·å车åºäºä»¶æ¨éã========æå======="); |
| | | }catch (Exception e){ |
| | | |
| | |
| | | return null; |
| | | } |
| | | |
| | | private CarEvent getParkEventModelByRequest(EventParkInfoRequest request) { |
| | | CarEvent event = new CarEvent(); |
| | | |
| | | return event; |
| | | |
| | | } |
| | | |
| | | private void saveInterfaceLog(Object param, String path,String result) { |
| | | InterfaceLog hkMonitoryLogDO=new InterfaceLog(); |
| | | hkMonitoryLogDO.setType(1); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.api.business; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.core.annotation.excel.ExcelExporter; |
| | | import com.doumee.core.annotation.pr.PreventRepeat; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.dao.business.model.UserAction; |
| | | import com.doumee.service.business.UserActionService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import org.apache.shiro.authz.annotation.RequiresPermissions; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import javax.servlet.http.HttpServletResponse; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/12/14 13:55 |
| | | */ |
| | | @Api(tags = "人åæä½è®°å½æ¥å¿") |
| | | @RestController |
| | | @RequestMapping("/business/userAction") |
| | | public class UserActionController extends BaseController { |
| | | |
| | | @Autowired |
| | | private UserActionService userActionService; |
| | | |
| | | @PreventRepeat |
| | | @ApiOperation("æ°å»º") |
| | | @PostMapping("/create") |
| | | @RequiresPermissions("business:useraction:create") |
| | | public ApiResponse create(@RequestBody UserAction userAction) { |
| | | return ApiResponse.success(userActionService.create(userAction)); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDå é¤") |
| | | @GetMapping("/delete/{id}") |
| | | @RequiresPermissions("business:useraction:delete") |
| | | public ApiResponse deleteById(@PathVariable Integer id) { |
| | | userActionService.deleteById(id); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ¹éå é¤") |
| | | @GetMapping("/delete/batch") |
| | | @RequiresPermissions("business:useraction:delete") |
| | | public ApiResponse deleteByIdInBatch(@RequestParam String ids) { |
| | | String [] idArray = ids.split(","); |
| | | List<Integer> idList = new ArrayList<>(); |
| | | for (String id : idArray) { |
| | | idList.add(Integer.valueOf(id)); |
| | | } |
| | | userActionService.deleteByIdInBatch(idList); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDä¿®æ¹") |
| | | @PostMapping("/updateById") |
| | | @RequiresPermissions("business:useraction:update") |
| | | public ApiResponse updateById(@RequestBody UserAction userAction) { |
| | | userActionService.updateById(userAction); |
| | | return ApiResponse.success(null); |
| | | } |
| | | |
| | | @ApiOperation("å页æ¥è¯¢") |
| | | @PostMapping("/page") |
| | | @RequiresPermissions("business:useraction:query") |
| | | public ApiResponse<PageData<UserAction>> findPage (@RequestBody PageWrap<UserAction> pageWrap) { |
| | | return ApiResponse.success(userActionService.findPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("导åºExcel") |
| | | @PostMapping("/exportExcel") |
| | | @RequiresPermissions("business:useraction:exportExcel") |
| | | public void exportExcel (@RequestBody PageWrap<UserAction> pageWrap, HttpServletResponse response) { |
| | | ExcelExporter.build(UserAction.class).export(userActionService.findPage(pageWrap).getRecords(), "人åæä½è®°å½æ¥å¿", response); |
| | | } |
| | | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @RequiresPermissions("business:useraction:query") |
| | | public ApiResponse findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(userActionService.findById(id)); |
| | | } |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business; |
| | | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.doumee.dao.business.model.UserAction; |
| | | |
| | | /** |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/12/14 13:55 |
| | | */ |
| | | public interface UserActionMapper extends BaseMapper<UserAction> { |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.business.model; |
| | | |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | | import com.baomidou.mybatisplus.annotation.TableId; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import lombok.Data; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * 人åæä½è®°å½æ¥å¿ |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/12/14 13:55 |
| | | */ |
| | | @Data |
| | | @ApiModel("人åæä½è®°å½æ¥å¿") |
| | | @TableName("`user_action`") |
| | | public class UserAction { |
| | | |
| | | @TableId(type = IdType.AUTO) |
| | | @ApiModelProperty(value = "主é®", example = "1") |
| | | @ExcelColumn(name="主é®") |
| | | private Integer id; |
| | | |
| | | @ApiModelProperty(value = "å建人ç¼ç ", example = "1") |
| | | @ExcelColumn(name="å建人ç¼ç ") |
| | | private Integer creator; |
| | | |
| | | @ApiModelProperty(value = "å建æ¶é´") |
| | | @ExcelColumn(name="å建æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date createDate; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°äººç¼ç ", example = "1") |
| | | @ExcelColumn(name="æ´æ°äººç¼ç ") |
| | | private Integer editor; |
| | | |
| | | @ApiModelProperty(value = "æ´æ°æ¶é´") |
| | | @ExcelColumn(name="æ´æ°æ¶é´") |
| | | @JsonFormat(pattern = "yyyy-MM-dd") |
| | | private Date editDate; |
| | | |
| | | @ApiModelProperty(value = "æ¯å¦å é¤0å¦ 1æ¯", example = "1") |
| | | @ExcelColumn(name="æ¯å¦å é¤0å¦ 1æ¯") |
| | | private Integer isdeleted; |
| | | |
| | | @ApiModelProperty(value = "夿³¨") |
| | | @ExcelColumn(name="夿³¨") |
| | | private String remark; |
| | | |
| | | @ApiModelProperty(value = "ç±»å 0è§£å» 1å»ç» 2æé» 3æ¢å¤ 4设为æè®¿äºº 5åæ¶æè®¿äºº 6设为é«çº§å®¡æ¹äºº 7åæ¶é«çº§å®¡æ¹äºº 8æå¨ç¦»åº 9å é¤", example = "1") |
| | | @ExcelColumn(name="ç±»å 0è§£å» 1å»ç» 2æé» 3æ¢å¤ 4设为æè®¿äºº 5åæ¶æè®¿äºº 6设为é«çº§å®¡æ¹äºº 7åæ¶é«çº§å®¡æ¹äºº 8æå¨ç¦»åº 9å é¤") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "人åæä½è®°å½æ¥å¿") |
| | | @ExcelColumn(name="人åæä½è®°å½æ¥å¿") |
| | | private String memberId; |
| | | |
| | | @ApiModelProperty(value = "æä½åç¶æ 0è§£å» 1å»ç» 2æé» 3æ¢å¤ 4设为æè®¿äºº 5åæ¶æè®¿äºº 6设为é«çº§å®¡æ¹äºº 7åæ¶é«çº§å®¡æ¹äºº 8æå¨ç¦»åº 9å é¤", example = "1") |
| | | @ExcelColumn(name="æä½åç¶æ 0è§£å» 1å»ç» 2æé» 3æ¢å¤ 4设为æè®¿äºº 5åæ¶æè®¿äºº 6设为é«çº§å®¡æ¹äºº 7åæ¶é«çº§å®¡æ¹äºº 8æå¨ç¦»åº 9å é¤") |
| | | private Integer beforeStatus; |
| | | |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.service.business; |
| | | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.business.model.UserAction; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 人åæä½è®°å½æ¥å¿Serviceå®ä¹ |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/12/14 13:55 |
| | | */ |
| | | public interface UserActionService { |
| | | |
| | | /** |
| | | * å建 |
| | | * |
| | | * @param userAction å®ä½å¯¹è±¡ |
| | | * @return Integer |
| | | */ |
| | | Integer create(UserAction userAction); |
| | | |
| | | /** |
| | | * 主é®å é¤ |
| | | * |
| | | * @param id ä¸»é® |
| | | */ |
| | | void deleteById(Integer id); |
| | | |
| | | /** |
| | | * å é¤ |
| | | * |
| | | * @param userAction å®ä½å¯¹è±¡ |
| | | */ |
| | | void delete(UserAction userAction); |
| | | |
| | | /** |
| | | * æ¹é主é®å é¤ |
| | | * |
| | | * @param ids 主é®é |
| | | */ |
| | | void deleteByIdInBatch(List<Integer> ids); |
| | | |
| | | /** |
| | | * 䏻鮿´æ° |
| | | * |
| | | * @param userAction å®ä½å¯¹è±¡ |
| | | */ |
| | | void updateById(UserAction userAction); |
| | | |
| | | /** |
| | | * æ¹é䏻鮿´æ° |
| | | * |
| | | * @param userActions å®ä½é |
| | | */ |
| | | void updateByIdInBatch(List<UserAction> userActions); |
| | | |
| | | /** |
| | | * 䏻鮿¥è¯¢ |
| | | * |
| | | * @param id ä¸»é® |
| | | * @return UserAction |
| | | */ |
| | | UserAction findById(Integer id); |
| | | |
| | | /** |
| | | * æ¡ä»¶æ¥è¯¢åæ¡è®°å½ |
| | | * |
| | | * @param userAction å®ä½å¯¹è±¡ |
| | | * @return UserAction |
| | | */ |
| | | UserAction findOne(UserAction userAction); |
| | | |
| | | /** |
| | | * æ¡ä»¶æ¥è¯¢ |
| | | * |
| | | * @param userAction å®ä½å¯¹è±¡ |
| | | * @return List<UserAction> |
| | | */ |
| | | List<UserAction> findList(UserAction userAction); |
| | | |
| | | /** |
| | | * å页æ¥è¯¢ |
| | | * |
| | | * @param pageWrap å页对象 |
| | | * @return PageData<UserAction> |
| | | */ |
| | | PageData<UserAction> findPage(PageWrap<UserAction> pageWrap); |
| | | |
| | | /** |
| | | * æ¡ä»¶ç»è®¡ |
| | | * |
| | | * @param userAction å®ä½å¯¹è±¡ |
| | | * @return long |
| | | */ |
| | | long count(UserAction userAction); |
| | | } |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.service.business.impl; |
| | | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.business.UserActionMapper; |
| | | import com.doumee.dao.business.model.UserAction; |
| | | import com.doumee.service.business.UserActionService; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | import org.springframework.util.CollectionUtils; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 人åæä½è®°å½æ¥å¿Serviceå®ç° |
| | | * @author æ±è¹è¹ |
| | | * @date 2023/12/14 13:55 |
| | | */ |
| | | @Service |
| | | public class UserActionServiceImpl implements UserActionService { |
| | | |
| | | @Autowired |
| | | private UserActionMapper userActionMapper; |
| | | |
| | | @Override |
| | | public Integer create(UserAction userAction) { |
| | | userActionMapper.insert(userAction); |
| | | return userAction.getId(); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteById(Integer id) { |
| | | userActionMapper.deleteById(id); |
| | | } |
| | | |
| | | @Override |
| | | public void delete(UserAction userAction) { |
| | | UpdateWrapper<UserAction> deleteWrapper = new UpdateWrapper<>(userAction); |
| | | userActionMapper.delete(deleteWrapper); |
| | | } |
| | | |
| | | @Override |
| | | public void deleteByIdInBatch(List<Integer> ids) { |
| | | if (CollectionUtils.isEmpty(ids)) { |
| | | return; |
| | | } |
| | | userActionMapper.deleteBatchIds(ids); |
| | | } |
| | | |
| | | @Override |
| | | public void updateById(UserAction userAction) { |
| | | userActionMapper.updateById(userAction); |
| | | } |
| | | |
| | | @Override |
| | | public void updateByIdInBatch(List<UserAction> userActions) { |
| | | if (CollectionUtils.isEmpty(userActions)) { |
| | | return; |
| | | } |
| | | for (UserAction userAction: userActions) { |
| | | this.updateById(userAction); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public UserAction findById(Integer id) { |
| | | return userActionMapper.selectById(id); |
| | | } |
| | | |
| | | @Override |
| | | public UserAction findOne(UserAction userAction) { |
| | | QueryWrapper<UserAction> wrapper = new QueryWrapper<>(userAction); |
| | | return userActionMapper.selectOne(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public List<UserAction> findList(UserAction userAction) { |
| | | QueryWrapper<UserAction> wrapper = new QueryWrapper<>(userAction); |
| | | return userActionMapper.selectList(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public PageData<UserAction> findPage(PageWrap<UserAction> pageWrap) { |
| | | IPage<UserAction> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | QueryWrapper<UserAction> queryWrapper = new QueryWrapper<>(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | if (pageWrap.getModel().getId() != null) { |
| | | queryWrapper.lambda().eq(UserAction::getId, pageWrap.getModel().getId()); |
| | | } |
| | | if (pageWrap.getModel().getCreator() != null) { |
| | | queryWrapper.lambda().eq(UserAction::getCreator, pageWrap.getModel().getCreator()); |
| | | } |
| | | if (pageWrap.getModel().getCreateDate() != null) { |
| | | queryWrapper.lambda().ge(UserAction::getCreateDate, Utils.Date.getStart(pageWrap.getModel().getCreateDate())); |
| | | queryWrapper.lambda().le(UserAction::getCreateDate, Utils.Date.getEnd(pageWrap.getModel().getCreateDate())); |
| | | } |
| | | if (pageWrap.getModel().getEditor() != null) { |
| | | queryWrapper.lambda().eq(UserAction::getEditor, pageWrap.getModel().getEditor()); |
| | | } |
| | | if (pageWrap.getModel().getEditDate() != null) { |
| | | queryWrapper.lambda().ge(UserAction::getEditDate, Utils.Date.getStart(pageWrap.getModel().getEditDate())); |
| | | queryWrapper.lambda().le(UserAction::getEditDate, Utils.Date.getEnd(pageWrap.getModel().getEditDate())); |
| | | } |
| | | if (pageWrap.getModel().getIsdeleted() != null) { |
| | | queryWrapper.lambda().eq(UserAction::getIsdeleted, pageWrap.getModel().getIsdeleted()); |
| | | } |
| | | if (pageWrap.getModel().getRemark() != null) { |
| | | queryWrapper.lambda().eq(UserAction::getRemark, pageWrap.getModel().getRemark()); |
| | | } |
| | | if (pageWrap.getModel().getType() != null) { |
| | | queryWrapper.lambda().eq(UserAction::getType, pageWrap.getModel().getType()); |
| | | } |
| | | if (pageWrap.getModel().getMemberId() != null) { |
| | | queryWrapper.lambda().eq(UserAction::getMemberId, pageWrap.getModel().getMemberId()); |
| | | } |
| | | if (pageWrap.getModel().getBeforeStatus() != null) { |
| | | queryWrapper.lambda().eq(UserAction::getBeforeStatus, pageWrap.getModel().getBeforeStatus()); |
| | | } |
| | | for(PageWrap.SortData sortData: pageWrap.getSorts()) { |
| | | if (sortData.getDirection().equalsIgnoreCase(PageWrap.DESC)) { |
| | | queryWrapper.orderByDesc(sortData.getProperty()); |
| | | } else { |
| | | queryWrapper.orderByAsc(sortData.getProperty()); |
| | | } |
| | | } |
| | | return PageData.from(userActionMapper.selectPage(page, queryWrapper)); |
| | | } |
| | | |
| | | @Override |
| | | public long count(UserAction userAction) { |
| | | QueryWrapper<UserAction> wrapper = new QueryWrapper<>(userAction); |
| | | return userActionMapper.selectCount(wrapper); |
| | | } |
| | | } |