| | |
| | | import org.apache.http.impl.client.CloseableHttpClient; |
| | | import org.apache.http.impl.client.HttpClientBuilder; |
| | | import org.apache.http.util.EntityUtils; |
| | | import org.apache.xpath.operations.Bool; |
| | | import sun.misc.BASE64Encoder; |
| | | |
| | | /** */ |
| | |
| | | // 设置PassiveModeä¼ è¾ |
| | | try { |
| | | ftpClient.enterLocalPassiveMode(); |
| | | |
| | | // 设置以äºè¿å¶æµçæ¹å¼ä¼ è¾ |
| | | ftpClient.setFileType(FTP.BINARY_FILE_TYPE); |
| | | ftpClient.setControlEncoding("GBK"); |
| | |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public boolean uploadInputstreamBatch(InputStream inputStream, String remote, Boolean close) { |
| | | // 设置PassiveModeä¼ è¾ |
| | | try { |
| | | ftpClient.enterLocalPassiveMode(); |
| | | // 设置以äºè¿å¶æµçæ¹å¼ä¼ è¾ |
| | | ftpClient.setFileType(FTP.BINARY_FILE_TYPE); |
| | | ftpClient.setControlEncoding("GBK"); |
| | | // 对è¿ç¨ç®å½çå¤ç |
| | | String remoteFileName = remote; |
| | | if (remote.contains("/")) { |
| | | remoteFileName = remote.substring(remote.lastIndexOf("/") + 1); |
| | | // å建æå¡å¨è¿ç¨ç®å½ç»æï¼åå»ºå¤±è´¥ç´æ¥è¿å |
| | | if (StringUtils.equals(CreateDirecroty(remote, ftpClient), "2")) { |
| | | log.error("å建ftpç®å½å¤±è´¥======================="+remote); |
| | | return false; |
| | | } |
| | | } |
| | | boolean result = ftpClient.storeFile(remoteFileName, inputStream); |
| | | inputStream.close(); |
| | | if(close){ |
| | | ftpClient.logout(); |
| | | } |
| | | if(result){ |
| | | log.info("ä¸ä¼ æä»¶æå======================"+remote); |
| | | }else{ |
| | | log.error("ä¸ä¼ æä»¶å¤±è´¥======================="+remote); |
| | | } |
| | | return result; |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | | log.error("ä¸ä¼ æä»¶å¤±è´¥======================="+remote); |
| | | } |
| | | return false; |
| | | } |
| | | |
| | | public int getNumFromStr(String str,char searchstr) { |
| | | int count = 0; |
| | | char[] charArray = str.toCharArray(); |
¶Ô±ÈÐÂÎļþ |
| | |
| | | package com.doumee.dao.system.dto; |
| | | |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | |
| | | import java.util.Date; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | | * |
| | | * @Author : Rk |
| | | * @create 2024/6/5 9:27 |
| | | */ |
| | | @Data |
| | | public class NoticesDTO { |
| | | |
| | | @ApiModelProperty(value = "ç¨æ·ä¸»é®",hidden = true) |
| | | private Integer memberId; |
| | | |
| | | @ApiModelProperty(value = "æ¥è¯¢ç±»å: 0=å¾
å¤çï¼1=å·²å¤çï¼2=æåå¸çï¼3=æéæ") |
| | | private Integer queryType; |
| | | |
| | | @ApiModelProperty(value = "å¼å§æ¥æ") |
| | | private Date startDate; |
| | | |
| | | @ApiModelProperty(value = "ç»ææ¥æ") |
| | | private Date endDate; |
| | | |
| | | @ApiModelProperty(value = "0è®¿å®¢å®¡æ¹ 1访客æ¥å¤ 2ç¨è½¦å®¡æ¹ 3鿣å¤ç 4ç©æµè½¦å®¡æ¹ 5ç³»ç»ç³»ç»") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value = "åªçæªè¯»ï¼1=æ¯ï¼0=å¦") |
| | | private Integer noRead; |
| | | |
| | | @ApiModelProperty(value = "ä»»å¡åç§°/æ é¢") |
| | | private String title; |
| | | } |
| | |
| | | private String typeDetail; |
| | | |
| | | |
| | | @ApiModelProperty(value = "å
³èåæ°1" ,notes = "åå¨ æ¶æ¯å±ç¤ºJSON ") |
| | | @ApiModelProperty(value = "åå¨ æ¶æ¯å±ç¤ºJSON" ,notes = "åå¨ æ¶æ¯å±ç¤ºJSON ") |
| | | @ExcelColumn(name="å
³èåæ°1") |
| | | private String param1; |
| | | |
| | | @ApiModelProperty(value = "å
³èåæ°2",notes = "ç¨äºåå¨ ä¸å¡ç¶æä¿¡æ¯ 0 =å¾
å¤ç;1=å·²åæ/å·²å¤ç;2=å·²æç»/å·²éå;3=已转交;4=å·²æ¤é") |
| | | @ApiModelProperty(value = "ç¨äºåå¨ ä¸å¡ç¶æä¿¡æ¯ 0 =å¾
å¤ç;1=å·²åæ/å·²å¤ç;2=å·²æç»/å·²éå;3=已转交;4=å·²æ¤é",notes = "ç¨äºåå¨ ä¸å¡ç¶æä¿¡æ¯ 0 =å¾
å¤ç;1=å·²åæ/å·²å¤ç;2=å·²æç»/å·²éå;3=已转交;4=å·²æ¤é") |
| | | @ExcelColumn(name="å
³èåæ°2") |
| | | private String param2; |
| | | |
| | | @ApiModelProperty(value = "å
³èåæ°3",notes = "å起人") |
| | | @ApiModelProperty(value = "å起人",notes = "å起人") |
| | | @ExcelColumn(name="å
³èåæ°3") |
| | | private String param3; |
| | | |
| | |
| | | |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.dao.system.dto.NoticesDTO; |
| | | import com.doumee.dao.system.model.Notices; |
| | | |
| | | import java.util.List; |
| | |
| | | long count(Notices notices); |
| | | |
| | | |
| | | PageData<Notices> taskCanterPage(PageWrap<NoticesDTO> pageWrap); |
| | | |
| | | |
| | | void signReadById(Integer noticesId); |
| | | |
| | | void signRead(Integer memberId); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.Utils; |
| | | import com.doumee.dao.system.dto.NoticesDTO; |
| | | import com.doumee.dao.system.join.NoticesJoinMapper; |
| | | import com.doumee.dao.system.model.Notices; |
| | | import com.doumee.service.system.NoticesService; |
| | | import com.github.xiaoymin.knife4j.core.util.CollectionUtils; |
| | | import com.github.yulichang.wrapper.MPJLambdaWrapper; |
| | | import org.apache.commons.lang3.StringUtils; |
| | | import org.apache.shiro.SecurityUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | import java.util.Objects; |
| | | |
| | | /** |
| | | * ç³»ç»æ¶æ¯ä¿¡æ¯è¡¨Serviceå®ç° |
| | |
| | | IPage<Notices> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | MPJLambdaWrapper<Notices> queryWrapper = new MPJLambdaWrapper<>(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | LoginUserInfo loginUserInfo = (LoginUserInfo) SecurityUtils.getSubject().getPrincipal(); |
| | | |
| | | queryWrapper.selectAll(Notices.class); |
| | | if (pageWrap.getModel().getIsdeleted() != null) { |
| | | queryWrapper.eq(Notices::getIsdeleted, pageWrap.getModel().getIsdeleted()); |
| | |
| | | return noticesMapper.selectCount(wrapper); |
| | | } |
| | | |
| | | @Override |
| | | public PageData<Notices> taskCanterPage(PageWrap<NoticesDTO> pageWrap) { |
| | | IPage<Notices> page = new Page<>(pageWrap.getPage(), pageWrap.getCapacity()); |
| | | MPJLambdaWrapper<Notices> queryWrapper = new MPJLambdaWrapper<>(); |
| | | Utils.MP.blankToNull(pageWrap.getModel()); |
| | | queryWrapper.selectAll(Notices.class); |
| | | NoticesDTO noticesDTO = pageWrap.getModel(); |
| | | if(Objects.isNull(noticesDTO) |
| | | || Objects.isNull(noticesDTO.getMemberId()) |
| | | || Objects.isNull(noticesDTO.getQueryType())){ |
| | | queryWrapper.eq("1","2"); |
| | | } |
| | | if(noticesDTO.getQueryType().equals(Constants.ZERO)){ |
| | | queryWrapper.eq(Notices::getStatus,Constants.ZERO); |
| | | queryWrapper.eq(Notices::getSendacopy,Constants.ZERO); |
| | | queryWrapper.eq(Notices::getUserId, noticesDTO.getMemberId()); |
| | | } else if(noticesDTO.getQueryType().equals(Constants.ONE)){ |
| | | queryWrapper.eq(Notices::getStatus,Constants.ONE); |
| | | queryWrapper.eq(Notices::getSendacopy,Constants.ZERO); |
| | | } else if(noticesDTO.getQueryType().equals(Constants.TWO)){ |
| | | queryWrapper.eq(Notices::getParam3, noticesDTO.getMemberId()); |
| | | } else if (noticesDTO.getQueryType().equals(Constants.THREE)) { |
| | | queryWrapper.eq(Notices::getUserId, noticesDTO.getMemberId()); |
| | | queryWrapper.eq(Notices::getSendacopy,Constants.ONE); |
| | | if(Objects.nonNull(noticesDTO.getNoRead())&&Constants.equalsInteger(noticesDTO.getNoRead(),Constants.ONE)){ |
| | | queryWrapper.eq(Notices::getReaded,Constants.ONE); |
| | | } |
| | | }else{ |
| | | queryWrapper.eq("1","2"); |
| | | } |
| | | queryWrapper.ge(noticesDTO.getStartDate() != null, Notices::getCreateDate, Utils.Date.getStart(noticesDTO.getStartDate() )); |
| | | queryWrapper.le(noticesDTO.getStartDate() != null, Notices::getCreateDate, Utils.Date.getEnd(noticesDTO.getStartDate() )); |
| | | queryWrapper.ge(noticesDTO.getEndDate() != null, Notices::getCreateDate, Utils.Date.getStart(noticesDTO.getEndDate() )); |
| | | queryWrapper.le(noticesDTO.getEndDate() != null, Notices::getCreateDate, Utils.Date.getEnd(noticesDTO.getEndDate() )); |
| | | queryWrapper.eq(Objects.nonNull(noticesDTO.getType()),Notices::getType,noticesDTO.getType()); |
| | | queryWrapper.eq(StringUtils.isNotBlank(noticesDTO.getTitle()),Notices::getTitle,noticesDTO.getTitle()); |
| | | queryWrapper.orderByDesc(Notices::getCreateDate); |
| | | PageData<Notices> pageData = PageData.from(noticesMapper.selectJoinPage(page,Notices.class, queryWrapper)); |
| | | return pageData; |
| | | } |
| | | |
| | | |
| | | /** |
| | | * æ 记已读 |
| | | * @param noticesId |
| | | */ |
| | | @Override |
| | | public void signReadById(Integer noticesId){ |
| | | if(Objects.isNull(noticesId)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | Notices notices = noticesMapper.selectById(noticesId); |
| | | if(Objects.isNull(notices)){ |
| | | throw new BusinessException(ResponseStatus.DATA_EMPTY); |
| | | } |
| | | if(Constants.equalsInteger(notices.getSendacopy(),Constants.ONE)){ |
| | | if(Constants.equalsInteger(Constants.ZERO,notices.getReaded())){ |
| | | noticesMapper.update(null,new UpdateWrapper<Notices>().lambda() |
| | | .set(Notices::getReaded,Constants.ONE).eq(Notices::getId,notices)); |
| | | } |
| | | }else{ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"éæéæ°æ®,æ æ³è¿è¡æ è®°"); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * æ¹éæ 记已读 |
| | | * @param memberId |
| | | */ |
| | | @Override |
| | | public void signRead(Integer memberId) { |
| | | noticesMapper.update(null, new UpdateWrapper<Notices>().lambda() |
| | | .set(Notices::getReaded, Constants.ONE) |
| | | .eq(Notices::getSendacopy,Constants.ONE) |
| | | .eq(Notices::getReaded,Constants.ZERO) |
| | | .eq(Notices::getUserId, memberId)); |
| | | } |
| | | |
| | | } |
| | |
| | | @GetMapping("/{id}") |
| | | @RequiresPermissions("business:visits:query") |
| | | public ApiResponse<Visits> findById(@PathVariable Integer id) { |
| | | return ApiResponse.success(visitsService.findById(id)); |
| | | return ApiResponse.success(visitsService.findById(id,null)); |
| | | } |
| | | |
| | | @ApiOperation("æ»ç人å") |
| | |
| | | @ApiOperation("æ ¹æ®IDæ¥è¯¢") |
| | | @GetMapping("/{id}") |
| | | @CloudRequiredPermission("business:hiddendanger:query") |
| | | public ApiResponse findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | public ApiResponse<HiddenDanger> findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | return ApiResponse.success(hiddenDangerService.findById(id)); |
| | | } |
| | | |
| | |
| | | package com.doumee.cloud.admin; |
| | | |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.model.ApiResponse; |
| | | import com.doumee.core.model.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.dao.admin.response.StagingDataVO; |
| | | import com.doumee.dao.business.model.Visits; |
| | | import com.doumee.dao.system.dto.NoticesDTO; |
| | | import com.doumee.dao.system.model.Notices; |
| | | import com.doumee.dao.web.response.InternalHomeVO; |
| | | import com.doumee.service.business.ApproveService; |
| | | import com.doumee.service.business.MemberService; |
| | | import com.doumee.service.business.VisitsService; |
| | | import com.doumee.service.system.NoticesService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | | 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 java.util.Objects; |
| | | |
| | | /** |
| | | * Created by IntelliJ IDEA. |
| | |
| | | @Autowired |
| | | private NoticesService noticesService; |
| | | |
| | | @Autowired |
| | | private ApproveService approveService; |
| | | |
| | | |
| | | @ApiOperation("头鍿°æ®") |
| | |
| | | } |
| | | |
| | | |
| | | @ApiOperation("ä»»å¡ä¸å¿å页") |
| | | @PostMapping("/taskPage") |
| | | @RequiresPermissions("business:notices:query") |
| | | public ApiResponse<PageData<Notices>> taskPage (@RequestBody PageWrap<Notices> pageWrap) { |
| | | pageWrap.getModel().setPalt(Constants.ZERO); |
| | | return ApiResponse.success(noticesService.findPage(pageWrap)); |
| | | |
| | | @ApiOperation(value = "ä»»å¡ä¸å¿å¤´é¨", notes = "H5") |
| | | @GetMapping("/taskCenterHead") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "isDetail", value = " æ¯å¦æ¥è¯¢è¯¦ç» 1æ¯ï¼0å¦", required = true), |
| | | }) |
| | | public ApiResponse<InternalHomeVO> taskCenterHead(@RequestParam Integer isDetail,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success("æ¥è¯¢æå",approveService.getHomeData(getLoginUser(token).getMemberId(),isDetail)); |
| | | } |
| | | |
| | | |
| | | @ApiOperation("ä»»å¡ä¸å¿å页") |
| | | @PostMapping("/taskPage") |
| | | public ApiResponse<PageData<Notices>> taskPage (@RequestBody PageWrap<NoticesDTO> pageWrap, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | LoginUserInfo loginUserInfo = getLoginUser(token); |
| | | pageWrap.getModel().setMemberId(loginUserInfo.getMemberId()); |
| | | return ApiResponse.success(noticesService.taskCanterPage(pageWrap)); |
| | | } |
| | | |
| | | @ApiOperation("æ 记已读") |
| | | @GetMapping("/signRead") |
| | | @ApiImplicitParams({ |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "noticesId", value = "è®°å½ä¸»é®", required = false), |
| | | @ApiImplicitParam(paramType = "query", dataType = "Integer", name = "signType", value = "æ è®°ç±»åï¼0=å个æ è®°;1=æ è®°å
¨é¨æªè¯»", required = false), |
| | | }) |
| | | public ApiResponse signRead (Integer noticesId,@RequestParam Integer signType, @RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | LoginUserInfo loginUserInfo = getLoginUser(token); |
| | | if(Constants.equalsInteger(signType,Constants.ZERO)){ |
| | | noticesService.signReadById(noticesId); |
| | | }else{ |
| | | noticesService.signRead(loginUserInfo.getMemberId()); |
| | | } |
| | | return ApiResponse.success("æä½æå"); |
| | | } |
| | | } |
| | |
| | | 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.LoginUserInfo; |
| | | import com.doumee.core.model.PageData; |
| | | import com.doumee.core.model.PageWrap; |
| | | import com.doumee.core.utils.Constants; |
| | |
| | | @PostMapping("/page") |
| | | @CloudRequiredPermission("business:visits:query") |
| | | public ApiResponse<PageData<Visits>> findPage (@RequestBody PageWrap<Visits> pageWrap,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | pageWrap.getModel().setMemberId(getLoginUser(token).getMemberId()); |
| | | return ApiResponse.success(visitsService.findPage(pageWrap)); |
| | | } |
| | | |
| | |
| | | @GetMapping("/{id}") |
| | | @CloudRequiredPermission("business:visits:query") |
| | | public ApiResponse<Visits> findById(@PathVariable Integer id,@RequestHeader(Constants.HEADER_USER_TOKEN) String token){ |
| | | return ApiResponse.success(visitsService.findById(id)); |
| | | LoginUserInfo loginUserInfo = getLoginUser(token); |
| | | return ApiResponse.success(visitsService.findById(id,loginUserInfo.getMemberId())); |
| | | } |
| | | |
| | | @ApiOperation("æ»ç人å") |
| | |
| | | @ApiOperation(value = "访客æ¥å¤", notes = "访客æ¥å¤") |
| | | @PostMapping("/createVisit") |
| | | public ApiResponse createVisit(@RequestBody Visits visits,@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | visits.setMemberId(getLoginUser(token).getMemberId()); |
| | | LoginUserInfo loginUserInfo = getLoginUser(token); |
| | | visits.setMemberId(loginUserInfo.getMemberId()); |
| | | visits.setCreateMemberId(loginUserInfo.getMemberId()); |
| | | visits.setReceptMemberId(visits.getMemberId()); |
| | | return ApiResponse.success("æ¥è¯¢æå", visitsService.visitReporting(visits)); |
| | | } |
| | |
| | | package com.doumee.cloud.common; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.doumee.api.BaseController; |
| | | import com.doumee.biz.system.SystemDictDataBiz; |
| | | import com.doumee.core.annotation.trace.Trace; |
| | | import com.doumee.core.constants.ResponseStatus; |
| | | import com.doumee.core.exception.BusinessException; |
| | | import com.doumee.core.utils.Constants; |
| | | import com.doumee.core.utils.DateUtil; |
| | | import com.doumee.core.utils.FtpUtil; |
| | | import com.doumee.core.utils.aliyun.ALiYunUtil; |
| | | import com.doumee.dao.system.model.SystemDict; |
| | | import com.doumee.dao.system.model.SystemDictData; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.io.PrintWriter; |
| | | import java.util.HashMap; |
| | | import java.util.Iterator; |
| | | import java.util.Map; |
| | | import java.util.UUID; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * @author Eva.Caesar Liu |
| | |
| | | |
| | | public static FtpUtil ftp = null; |
| | | |
| | | @ApiOperation(value = "æ¹éä¸ä¼ æä»¶å°FTP") |
| | | @RequestMapping(method= RequestMethod.POST,value="/uploadBatch") |
| | | @ResponseBody |
| | | public void uploadBatch(HttpServletRequest request, HttpServletResponse response, String folder) throws Exception { |
| | | if(Objects.isNull(folder)){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | SystemDictData folderData = systemDictDataBiz.queryByCode(Constants.FTP,folder); |
| | | if(Objects.isNull(folderData)||StringUtils.isBlank(folderData.getCode())){ |
| | | throw new BusinessException(ResponseStatus.NOT_ALLOWED.getCode(),"ç®æ æä»¶å¤¹é误"); |
| | | } |
| | | folder = systemDictDataBiz.queryByCode(Constants.FTP,folder).getCode(); |
| | | String prefixPath = systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode(); |
| | | response.setCharacterEncoding("UTF-8"); |
| | | response.setContentType("text/html;charset=UTF-8"); |
| | | Map<String, Object> context = new HashMap<>(); |
| | | try { |
| | | if(ftp == null){ |
| | | ftp = new FtpUtil(systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_HOST).getCode(), |
| | | Integer.parseInt(systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_PORT).getCode()), |
| | | systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_USERNAME).getCode(), |
| | | systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_PWD).getCode()); |
| | | }else{ |
| | | ftp.connect(); |
| | | } |
| | | |
| | | context.put("success", true); |
| | | context.put("code", 200); |
| | | context.put("errno",0); |
| | | CommonsMultipartResolver multipartResovler = new CommonsMultipartResolver(); |
| | | if (multipartResovler.isMultipart(request)) { |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | | List<MultipartFile> fileList = multipartRequest.getFiles("file"); |
| | | Iterator<String> it = multipartRequest.getFileNames(); |
| | | JSONArray jsonArray = new JSONArray(); |
| | | |
| | | if (fileList.size() > 0) { |
| | | //éåæä»¶å表 |
| | | Iterator<MultipartFile> fileIte = fileList.iterator(); |
| | | Integer index = Constants.ONE; |
| | | while (fileIte.hasNext()) { |
| | | //è·å¾æ¯ä¸ä¸ªæä»¶ |
| | | MultipartFile file = fileIte.next(); |
| | | String originname = file.getOriginalFilename(); |
| | | InputStream is = file.getInputStream(); |
| | | String endType = originname.substring(originname.lastIndexOf("."), originname.length()); |
| | | String date = DateUtil.getNowShortDate(); |
| | | String fName = date + "/" + UUID.randomUUID() + endType; |
| | | String fileName = folder + "/" + fName; |
| | | boolean r = ftp.uploadInputstreamBatch(is, fileName, Constants.equalsInteger(index ,fileList.size())); |
| | | if (r) { |
| | | JSONObject fileJSON = new JSONObject(); |
| | | fileJSON.put("url", prefixPath + fileName); |
| | | fileJSON.put("imgaddr", fName); |
| | | fileJSON.put("imgname", fileName); |
| | | fileJSON.put("originname", originname); |
| | | jsonArray.add(fileJSON); |
| | | } |
| | | index = index + 1; |
| | | } |
| | | |
| | | } |
| | | |
| | | // while (it.hasNext()) { |
| | | // MultipartFile file = multipartRequest.getFile(it.next()); |
| | | // String originname = file.getOriginalFilename(); |
| | | // is = file.getInputStream(); |
| | | // String endType = originname.substring(originname.lastIndexOf("."),originname.length()); |
| | | // String date = DateUtil.getNowShortDate(); |
| | | // String fName = date+"/"+ UUID.randomUUID()+endType; |
| | | // String fileName = folder+"/"+fName; |
| | | // boolean r = ftp.uploadInputstream(is,fileName); |
| | | // if(r){ |
| | | // JSONObject fileJSON = new JSONObject(); |
| | | // fileJSON.put("url", prefixPath+fileName); |
| | | // fileJSON.put("imgaddr", fName); |
| | | // fileJSON.put("imgname", fileName); |
| | | // fileJSON.put("originname", originname); |
| | | // jsonArray.add(fileJSON); |
| | | // } |
| | | // } |
| | | context.put("data",jsonArray); |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("ãä¸ä¼ FTP失败ã======================"+e.getMessage()); |
| | | context.put("code", 0); |
| | | context.put("message", "ä¸ä¼ 失败"); |
| | | context.put("errno",0); |
| | | writerJson(response, context); |
| | | return; |
| | | |
| | | } |
| | | writerJson(response, context); |
| | | return; |
| | | } |
| | | |
| | | @ApiOperation(value = "ä¸ä¼ æä»¶å°FTP") |
| | | @RequestMapping(method= RequestMethod.POST,value="/upload") |
| | | @ResponseBody |
| | |
| | | private ApproveService approveService; |
| | | |
| | | |
| | | @ApiOperation(value = "å
é¨äººåé¦é¡µ", notes = "H5") |
| | | @GetMapping("/internalHome") |
| | | public ApiResponse<InternalHomeVO> internalHome(@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | return ApiResponse.success("æ¥è¯¢æå",approveService.getHomeData(getLoginUser(token).getMemberId())); |
| | | } |
| | | // @ApiOperation(value = "å
é¨äººåé¦é¡µ", notes = "H5") |
| | | // @GetMapping("/internalHome") |
| | | // public ApiResponse<InternalHomeVO> internalHome(@RequestHeader(Constants.HEADER_USER_TOKEN) String token) { |
| | | // return ApiResponse.success("æ¥è¯¢æå",approveService.getHomeData(getLoginUser(token).getMemberId())); |
| | | // } |
| | | |
| | | @ApiOperation("ä»»å¡ä¸å¿") |
| | | @PostMapping("/taskCenter") |
| | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.doumee.core.annotation.excel.ExcelColumn; |
| | | import com.doumee.core.model.LoginUserModel; |
| | | import com.doumee.dao.business.vo.ApproveDataVO; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import com.baomidou.mybatisplus.annotation.IdType; |
| | |
| | | @ApiModelProperty(value = "离åºç¶æï¼0=æªç¦»åº", example = "1",hidden = true) |
| | | @TableField(exist = false) |
| | | private Integer levelStatus; |
| | | |
| | | @ApiModelProperty(value = "å建人å§å", example = "1") |
| | | @TableField(exist = false) |
| | | private String createMemberName; |
| | | |
| | | @ApiModelProperty(value = "审æ¹ä¿¡æ¯æ°æ®") |
| | | @TableField(exist = false) |
| | | private ApproveDataVO approveDateVO; |
| | | |
| | | } |
| | |
| | | * @param memberId |
| | | * @return |
| | | */ |
| | | InternalHomeVO getHomeData(Integer memberId); |
| | | InternalHomeVO getHomeData(Integer memberId,Integer isDetail); |
| | | |
| | | void createApproveFlow(Integer tempType,Integer businessId,Integer createMemberId); |
| | | |
| | |
| | | * @param id ä¸»é® |
| | | * @return Visits |
| | | */ |
| | | Visits findById(Integer id); |
| | | Visits findById(Integer id,Integer memberId); |
| | | |
| | | /** |
| | | * æ¡ä»¶æ¥è¯¢åæ¡è®°å½ |
| | |
| | | /** |
| | | * å
é¨äººåH5页é¢é¦é¡µ |
| | | * @param memberId |
| | | * @param isDetail æ¯å¦æ¥è¯¢è¯¦ç» 1æ¯ï¼0å¦ |
| | | * @return |
| | | */ |
| | | @Override |
| | | public InternalHomeVO getHomeData(Integer memberId){ |
| | | public InternalHomeVO getHomeData(Integer memberId,Integer isDetail){ |
| | | InternalHomeVO internalHomeVO = new InternalHomeVO(); |
| | | internalHomeVO.setHomeImg(systemDictDataBiz.queryByCode(Constants.SYSTEM,Constants.HOME_IMAGE).getCode()); |
| | | internalHomeVO.setTaskNum(approveMapper.selectCount(new QueryWrapper<Approve>().lambda().eq(Approve::getChekorId,memberId).eq(Approve::getStatus,Constants.ZERO))); |
| | | //任塿°æ® |
| | | List<Notices> noticesList = noticesJoinMapper.selectList(new QueryWrapper<Notices>().lambda().eq(Notices::getUserId,memberId).orderByDesc(Notices::getCreateDate)); |
| | | List<Notices> noticesList = noticesJoinMapper. |
| | | selectList(new QueryWrapper<Notices>().lambda() |
| | | .eq(Notices::getUserId,memberId).orderByDesc(Notices::getCreateDate)); |
| | | internalHomeVO.setTaskNum(noticesList.size()); |
| | | if(Constants.equalsInteger(Constants.ONE,isDetail)){ |
| | | if(CollectionUtils.isNotEmpty(noticesList)){ |
| | | //å¾
æå¤ççæ°æ® |
| | | internalHomeVO.setNoticeWaitNum( |
| | |
| | | ).count() |
| | | ); |
| | | } |
| | | |
| | | |
| | | } |
| | | |
| | | return internalHomeVO; |
| | | } |
| | |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST); |
| | | } |
| | | hiddenDanger.setMemberId(hiddenDanger.getLoginUserInfo().getMemberId()); |
| | | hiddenDanger.setIsdeleted(Constants.ZERO); |
| | | hiddenDanger.setCreateDate(new Date()); |
| | | hiddenDanger.setEditDate(new Date()); |
| | |
| | | hiddenDangerLog.setObjType(Constants.ZERO); |
| | | hiddenDangerLogMapper.insert(hiddenDangerLog); |
| | | |
| | | List<Multifile> multifiles = hiddenDanger.getMultifileList(); |
| | | List<Multifile> multifiles = hiddenDanger.getSubmitFileList(); |
| | | if(com.github.xiaoymin.knife4j.core.util.CollectionUtils.isNotEmpty(multifiles)){ |
| | | for (int i = 0; i < multifiles.size(); i++) { |
| | | Multifile multifile = multifiles.get(i); |
| | |
| | | String title = "[鿣鿿]ææ¥äºº-"+hiddenDanger.getLoginUserInfo().getRealname(); |
| | | //jsonæ°æ® |
| | | Map<String,Object> jsonMap = new HashMap<>(); |
| | | jsonMap.put("name", "åç°åºå:" + hiddenDangerParam.getName()); |
| | | jsonMap.put("name", "éæ£ç±»å:" + hiddenDangerCate.getName()); |
| | | jsonMap.put("area", "åç°åºå:" + hiddenDangerParam.getName()); |
| | | jsonMap.put("cate", "éæ£ç±»å:" + hiddenDangerCate.getName()); |
| | | jsonMap.put("sTime", "åç°æ¶é´:" + DateUtil.DateToStr(hiddenDanger.getSubmitTime() , "yyyy-MM-dd HH:mm")); |
| | | //é»è®¤çæä¸æ¡ ç³è¯·äººçæ°æ® æ è®°å é¤ç¶æç¨äºå¤çå° ä»»å¡ä¸å¿ï¼æåèµ·ï¼ä½¿ç¨ |
| | | Notices createNotices = new Notices(); |
| | |
| | | //å建æ¶é´ |
| | | visits.setCreateDate(date); |
| | | //访客æ¥å¤ |
| | | visits.setIsdeleted(Constants.ZERO); |
| | | visits.setType(Constants.TWO); |
| | | visits.setReceptMemberId(visitMember.getId()); |
| | | visits.setStatus(Constants.VisitStatus.waitCheck); |
| | |
| | | //åå§åè®¿å®¢ä¿¡æ¯ |
| | | // initVisitInfo(visits,date); |
| | | visitsMapper.insert(visits); |
| | | approveService.createApproveFlow(visits.getType(),visits.getId(),visits.getReceptMemberId()); |
| | | return visits.getId(); |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | //访客æ¥å¤ |
| | | if(visits.getType().equals(Constants.TWO) |
| | | if(Constants.equalsInteger(visits.getType(),Constants.TWO) |
| | | && (StringUtils.isBlank( visits.getName()) |
| | | || StringUtils.isBlank( visits.getPhone()) |
| | | || StringUtils.isBlank( visits.getCompanyName())) |
| | | || StringUtils.isBlank( visits.getCompanyName()) |
| | | || StringUtils.isBlank( visits.getCarNos()) |
| | | || Objects.isNull(visits.getReceptMemberId()) |
| | | || Objects.isNull(visits.getReceptMemberId())) |
| | | ){ |
| | | throw new BusinessException(ResponseStatus.BAD_REQUEST.getCode(), "对ä¸èµ·ï¼ä¿¡æ¯å¡«å䏿£ç¡®ï¼"); |
| | | }else if(visits.getType().equals(Constants.ONE) && StringUtils.isBlank(visits.getConstructionReason())){ |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Visits findById(Integer id) { |
| | | public Visits findById(Integer id,Integer memberId) { |
| | | |
| | | MPJLambdaWrapper<Visits> queryWrapper = new MPJLambdaWrapper<>(); |
| | | queryWrapper.selectAll(Visits.class); |
| | | queryWrapper.selectAs(Member::getName,Visits::getReceptMemberName); |
| | | queryWrapper.selectAs(Company::getName,Visits::getReceptMemberDepartment); |
| | | queryWrapper.select("t3.name",Visits::getCreateMemberName); |
| | | queryWrapper.leftJoin(Member.class,Member::getId,Visits::getReceptMemberId); |
| | | queryWrapper.leftJoin(Company.class,Company::getErpId,Member::getErpOrgId); |
| | | queryWrapper.leftJoin("Member t3 on t.CREATE_MEMBER_ID=t3.id"); |
| | | |
| | | queryWrapper.eq(Visits::getId,id); |
| | | Visits result = visitsJoinMapper.selectJoinOne(Visits.class,queryWrapper); |
| | |
| | | result.setWithUserList(visitsList); |
| | | result.setPrefixUrl(systemDictDataBiz.queryByCode(Constants.FTP,Constants.FTP_RESOURCE_PATH).getCode() + |
| | | systemDictDataBiz.queryByCode(Constants.FTP,Constants.MEMBER_IMG).getCode()); |
| | | |
| | | result.setApproveDateVO( |
| | | approveService.arrangeApprovedData(id, |
| | | result.getType(), |
| | | memberId) |
| | | ); |
| | | |
| | | return result; |
| | | } |
| | | |
| | |
| | | queryWrapper.leftJoin(Company.class,Company::getId,Member::getCompanyId); |
| | | |
| | | queryWrapper.eq(Visits::getIsdeleted,Constants.ZERO); |
| | | queryWrapper.eq(pageWrap.getModel().getType()!=null,Visits::getType,pageWrap.getModel().getType()); |
| | | queryWrapper.eq(Objects.nonNull(pageWrap.getModel().getType()),Visits::getType,pageWrap.getModel().getType()); |
| | | queryWrapper.eq(StringUtils.isNotBlank(pageWrap.getModel().getOpenid()),Visits::getOpenid,pageWrap.getModel().getOpenid()); |
| | | queryWrapper.eq(StringUtils.isBlank(pageWrap.getModel().getOpenid()),"1","2"); |
| | | // queryWrapper.eq(StringUtils.isBlank(pageWrap.getModel().getOpenid()),"1","2"); |
| | | queryWrapper.and(StringUtils.isNotBlank(pageWrap.getModel().getName()),ms->ms.like(Visits::getName,pageWrap.getModel().getName()) |
| | | .or().like(Visits::getPhone,pageWrap.getModel().getName())) |
| | | .eq(StringUtils.isNotBlank(pageWrap.getModel().getIdcardNo()),Visits::getIdcardNo,DESUtil.encrypt(Constants.EDS_PWD, pageWrap.getModel().getIdcardNo())) |