| | |
| | | package com.zy.crm.common.utils; |
| | | |
| | | import java.io.*; |
| | | |
| | | import com.zy.crm.manager.entity.PlanUrl; |
| | | import org.springframework.core.io.Resource; |
| | | |
| | | import java.net.URLEncoder; |
| | |
| | | // this.path = path; |
| | | } |
| | | |
| | | public FileDTO(PlanUrl planUrl) { |
| | | this.name = planUrl.getName(); |
| | | this.size = planUrl.getFileSize(); |
| | | this.path = planUrl.getUrl(); |
| | | this.userName = planUrl.getUserName(); |
| | | } |
| | | |
| | | public FileDTO(boolean success, String name, String errorMessage) { |
| | | this.success = success; |
| | | this.name = name; |
| | |
| | | return R.ok(); |
| | | } |
| | | |
| | | @RequestMapping(value = "/plan/insert/file/auth") |
| | | // @ManagerAuth |
| | | public R insertFile(@RequestParam("planId") String planId, @RequestParam("filename") String filename, |
| | | @RequestParam("filesize") Long filesize,@RequestParam("token") String token) { |
| | | try { |
| | | // InputStream inputStream = file.getInputStream(); |
| | | // // 获取文件的内容类型 |
| | | // String contentType = file.getContentType(); |
| | | // String url = ossService.upload(inputStream, file.getOriginalFilename(), contentType); |
| | | //// String url = "http://tjdt.oss-cn-hangzhou.aliyuncs.com/"+file.getOriginalFilename(); |
| | | // String[] names = url.split("com/"); |
| | | // String name= names[1]; |
| | | String nickname = null; |
| | | Long userId = null; |
| | | if (!Cools.isEmpty(token)) { |
| | | User user = getUser(token); |
| | | nickname = user.getNickname(); |
| | | userId = user.getId(); |
| | | } |
| | | String[] split = planId.split("-"); |
| | | int id = Integer.parseInt(split[1]); |
| | | String url = "http://zhongyang-ftpserver.oss-cn-hangzhou.aliyuncs.com/" + filename; |
| | | planService.increasePlanUrl(id, url, filename, filesize,nickname,userId); |
| | | return R.ok(); |
| | | } catch (Exception e) { |
| | | System.out.println(e); |
| | | return R.error(); |
| | | } |
| | | } |
| | | |
| | | private String getFileSuffix(String filename) { |
| | | int dotIndex = filename.lastIndexOf("."); |
| | | if (dotIndex > 0 && dotIndex < filename.length() - 1) { |
| | |
| | | // } |
| | | // return R.ok(); |
| | | // } |
| | | |
| | | @RequestMapping(value = "/plan/view/file/auth") |
| | | // @ManagerAuth |
| | | public R viewFile(@RequestParam("planId") String planId){ |
| | | List<FileSaveExampleUtil.FileDTO> fileDTOS = new ArrayList<>(); |
| | | if (Cools.isEmpty(planId)){ |
| | | return R.ok(fileDTOS); |
| | | } |
| | | int id = Integer.parseInt(planId); |
| | | // String savePath = "D:/crm/plan/file/"+id+"/"; // 指定保存文件的路径 |
| | | try{ |
| | | List<Integer> ids = planService.selectPlanUrlId(id); |
| | | for (int id2 : ids){ |
| | | String url = planService.selectPlanUrlPlanIdUrl(id2); |
| | | String name = planService.selectPlanUrlPlanIdName(id2); |
| | | Long size = planService.selectPlanUrlPlanIdSize(id2); |
| | | String userName = planService.selectPlanUrlPlanIdUserName(id2); |
| | | FileSaveExampleUtil.FileDTO dto = new FileSaveExampleUtil.FileDTO(name,size,url,userName); |
| | | fileDTOS.add(dto); |
| | | } |
| | | // List<FileSaveExampleUtil.FileDTO> fileDTOS = FileSaveExampleUtil.viewFileList(savePath); |
| | | return R.ok(fileDTOS); |
| | | }catch (Exception e){ |
| | | return R.error(); |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/plan/download/file/auth") |
| | | // @ManagerAuth |
New file |
| | |
| | | package com.zy.crm.manager.controller; |
| | | |
| | | import com.alibaba.fastjson.JSONArray; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.baomidou.mybatisplus.mapper.Wrapper; |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.core.common.DateUtils; |
| | | import com.zy.crm.common.utils.FileSaveExampleUtil; |
| | | import com.zy.crm.manager.entity.PlanUrl; |
| | | import com.zy.crm.manager.service.PlanUrlService; |
| | | import com.core.annotations.ManagerAuth; |
| | | import com.core.common.BaseRes; |
| | | import com.core.common.Cools; |
| | | import com.core.common.R; |
| | | import com.core.domain.KeyValueVo; |
| | | import com.zy.crm.common.web.BaseController; |
| | | import com.zy.crm.system.entity.User; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | public class PlanUrlController extends BaseController { |
| | | |
| | | @Autowired |
| | | private PlanUrlService planUrlService; |
| | | |
| | | // @RequestMapping(value = "/planUrl/{id}/auth") |
| | | // @ManagerAuth |
| | | // public R get(@PathVariable("id") String id) { |
| | | // return R.ok(planUrlService.selectById(String.valueOf(id))); |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/planUrl/list/auth") |
| | | // @ManagerAuth |
| | | // public R list(@RequestParam(defaultValue = "1")Integer curr, |
| | | // @RequestParam(defaultValue = "10")Integer limit, |
| | | // @RequestParam(required = false)String orderByField, |
| | | // @RequestParam(required = false)String orderByType, |
| | | // @RequestParam(required = false)String condition, |
| | | // @RequestParam Map<String, Object> param){ |
| | | // EntityWrapper<PlanUrl> wrapper = new EntityWrapper<>(); |
| | | // excludeTrash(param); |
| | | // convert(param, wrapper); |
| | | // allLike(PlanUrl.class, param.keySet(), wrapper, condition); |
| | | // if (!Cools.isEmpty(orderByField)){wrapper.orderBy(humpToLine(orderByField), "asc".equals(orderByType));} |
| | | // return R.ok(planUrlService.selectPage(new Page<>(curr, limit), wrapper)); |
| | | // } |
| | | // |
| | | // private <T> void convert(Map<String, Object> map, EntityWrapper<T> wrapper){ |
| | | // for (Map.Entry<String, Object> entry : map.entrySet()){ |
| | | // String val = String.valueOf(entry.getValue()); |
| | | // if (val.contains(RANGE_TIME_LINK)){ |
| | | // String[] dates = val.split(RANGE_TIME_LINK); |
| | | // wrapper.ge(entry.getKey(), DateUtils.convert(dates[0])); |
| | | // wrapper.le(entry.getKey(), DateUtils.convert(dates[1])); |
| | | // } else { |
| | | // wrapper.like(entry.getKey(), val); |
| | | // } |
| | | // } |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/planUrl/add/auth") |
| | | // @ManagerAuth |
| | | // public R add(PlanUrl planUrl) { |
| | | // planUrlService.insert(planUrl); |
| | | // return R.ok(); |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/planUrl/update/auth") |
| | | // @ManagerAuth |
| | | // public R update(PlanUrl planUrl){ |
| | | // if (Cools.isEmpty(planUrl) || null==planUrl.getId()){ |
| | | // return R.error(); |
| | | // } |
| | | // planUrlService.updateById(planUrl); |
| | | // return R.ok(); |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/planUrl/delete/auth") |
| | | // @ManagerAuth |
| | | // public R delete(@RequestParam(value="ids[]") Long[] ids){ |
| | | // for (Long id : ids){ |
| | | // planUrlService.deleteById(id); |
| | | // } |
| | | // return R.ok(); |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/planUrl/export/auth") |
| | | // @ManagerAuth |
| | | // public R export(@RequestBody JSONObject param){ |
| | | // EntityWrapper<PlanUrl> wrapper = new EntityWrapper<>(); |
| | | // List<String> fields = JSONObject.parseArray(param.getJSONArray("fields").toJSONString(), String.class); |
| | | // Map<String, Object> map = excludeTrash(param.getJSONObject("planUrl")); |
| | | // convert(map, wrapper); |
| | | // List<PlanUrl> list = planUrlService.selectList(wrapper); |
| | | // return R.ok(exportSupport(list, fields)); |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/planUrlQuery/auth") |
| | | // @ManagerAuth |
| | | // public R query(String condition) { |
| | | // EntityWrapper<PlanUrl> wrapper = new EntityWrapper<>(); |
| | | // wrapper.like("id", condition); |
| | | // Page<PlanUrl> page = planUrlService.selectPage(new Page<>(0, 10), wrapper); |
| | | // List<Map<String, Object>> result = new ArrayList<>(); |
| | | // for (PlanUrl planUrl : page.getRecords()){ |
| | | // Map<String, Object> map = new HashMap<>(); |
| | | // map.put("id", planUrl.getId()); |
| | | // map.put("value", planUrl.getId()); |
| | | // result.add(map); |
| | | // } |
| | | // return R.ok(result); |
| | | // } |
| | | // |
| | | // @RequestMapping(value = "/planUrl/check/column/auth") |
| | | // @ManagerAuth |
| | | // public R query(@RequestBody JSONObject param) { |
| | | // Wrapper<PlanUrl> wrapper = new EntityWrapper<PlanUrl>().eq(humpToLine(String.valueOf(param.get("key"))), param.get("val")); |
| | | // if (null != planUrlService.selectOne(wrapper)){ |
| | | // return R.parse(BaseRes.REPEAT).add(getComment(PlanUrl.class, String.valueOf(param.get("key")))); |
| | | // } |
| | | // return R.ok(); |
| | | // } |
| | | // |
| | | // @RequestMapping("/planUrl/all/get/kv") |
| | | // @ManagerAuth |
| | | // public R getDataKV(@RequestParam(required = false) String condition) { |
| | | // List<KeyValueVo> vos = new ArrayList<>(); |
| | | // Wrapper<PlanUrl> wrapper = new EntityWrapper<PlanUrl>().andNew().like("id", condition).orderBy("create_time", false); |
| | | // planUrlService.selectPage(new Page<>(1, 30), wrapper).getRecords().forEach(item -> vos.add(new KeyValueVo(String.valueOf(item.getId()), item.getId()))); |
| | | // return R.ok().add(vos); |
| | | // } |
| | | |
| | | @RequestMapping(value = "/plan/url/view/file/auth") |
| | | // @ManagerAuth |
| | | public R viewFile(@RequestParam("planId") String planId){ |
| | | List<FileSaveExampleUtil.FileDTO> fileDTOS = new ArrayList<>(); |
| | | if (Cools.isEmpty(planId)){ |
| | | return R.ok(fileDTOS); |
| | | } |
| | | Long id = Long.parseLong(planId); |
| | | // String savePath = "D:/crm/plan/file/"+id+"/"; // 指定保存文件的路径 |
| | | try{ |
| | | List<PlanUrl> planUrls = planUrlService.selectPlanUrlByPlanId(id); |
| | | for (PlanUrl planUrl : planUrls){ |
| | | FileSaveExampleUtil.FileDTO dto = new FileSaveExampleUtil.FileDTO(planUrl); |
| | | fileDTOS.add(dto); |
| | | } |
| | | // List<FileSaveExampleUtil.FileDTO> fileDTOS = FileSaveExampleUtil.viewFileList(savePath); |
| | | return R.ok(fileDTOS); |
| | | }catch (Exception e){ |
| | | return R.error(); |
| | | } |
| | | } |
| | | |
| | | @RequestMapping(value = "/plan/url/insert/file/auth") |
| | | // @ManagerAuth |
| | | public R insertFile(@RequestParam("planId") String planId, @RequestParam("filename") String filename, |
| | | @RequestParam("filesize") Long filesize,@RequestParam("token") String token) { |
| | | try { |
| | | String nickname = null; |
| | | Long userId = null; |
| | | if (!Cools.isEmpty(token)) { |
| | | User user = getUser(token); |
| | | nickname = user.getNickname(); |
| | | userId = user.getId(); |
| | | } |
| | | String[] split = planId.split("-"); |
| | | Long id = Long.parseLong(split[1]); |
| | | String url = "http://zhongyang-ftpserver.oss-cn-hangzhou.aliyuncs.com/" + filename; |
| | | PlanUrl planUrl = new PlanUrl(id, url, filename, filesize,nickname,userId,0,0,0); |
| | | planUrlService.insert(planUrl); |
| | | return R.ok(); |
| | | } catch (Exception e) { |
| | | System.out.println(e); |
| | | return R.error(); |
| | | } |
| | | } |
| | | |
| | | } |
New file |
| | |
| | | package com.zy.crm.manager.entity; |
| | | |
| | | import com.core.common.Cools;import com.baomidou.mybatisplus.annotations.TableId; |
| | | import com.baomidou.mybatisplus.enums.IdType; |
| | | import com.baomidou.mybatisplus.annotations.TableField; |
| | | |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import com.baomidou.mybatisplus.annotations.TableName; |
| | | import java.io.Serializable; |
| | | |
| | | @Data |
| | | @TableName("man_plan_url") |
| | | public class PlanUrl implements Serializable { |
| | | |
| | | private static final long serialVersionUID = 1L; |
| | | |
| | | /** |
| | | * ID |
| | | */ |
| | | @ApiModelProperty(value= "ID") |
| | | @TableId(value = "id", type = IdType.AUTO) |
| | | private Long id; |
| | | |
| | | @ApiModelProperty(value= "planId") |
| | | @TableField("plan_id") |
| | | private Long planId; |
| | | |
| | | @ApiModelProperty(value= "url") |
| | | private String url; |
| | | |
| | | @ApiModelProperty(value= "文件名") |
| | | private String name; |
| | | |
| | | @ApiModelProperty(value= "大小") |
| | | @TableField("file_size") |
| | | private Long fileSize; |
| | | |
| | | /** |
| | | * 上传者 |
| | | */ |
| | | @ApiModelProperty(value= "上传者") |
| | | @TableField("user_name") |
| | | private String userName; |
| | | |
| | | /** |
| | | * 上传者ID |
| | | */ |
| | | @ApiModelProperty(value= "上传者ID") |
| | | @TableField("user_id") |
| | | private Long userId; |
| | | |
| | | @ApiModelProperty(value= "分类") |
| | | private Integer type; |
| | | |
| | | @ApiModelProperty(value= "隐藏") |
| | | @TableField("hide_url") |
| | | private Integer hideUrl; |
| | | |
| | | @ApiModelProperty(value= "状态") |
| | | private Integer status; |
| | | |
| | | public PlanUrl() {} |
| | | |
| | | public PlanUrl(Long planId,String url,String name,Long fileSize,String userName,Long userId,Integer type,Integer hideUrl,Integer status) { |
| | | this.planId = planId; |
| | | this.url = url; |
| | | this.name = name; |
| | | this.fileSize = fileSize; |
| | | this.userName = userName; |
| | | this.userId = userId; |
| | | this.type = type; |
| | | this.hideUrl = hideUrl; |
| | | this.status = status; |
| | | } |
| | | |
| | | // PlanUrl planUrl = new PlanUrl( |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null, // |
| | | // null, // 上传者 |
| | | // null, // 上传者ID |
| | | // null, // |
| | | // null, // |
| | | // null // |
| | | // ); |
| | | |
| | | |
| | | } |
| | |
| | | |
| | | Plan selectByUuid(@Param("hostId") Long hostId, @Param("uuid") String uuid); |
| | | |
| | | void increasePlanUrl(@Param("planId") int planId, @Param("url") String url, @Param("name") String name, @Param("size") Long size,@Param("userName") String userName, @Param("userId") Long userId ); |
| | | |
| | | String selectPlanUrlPlanIdUrl(@Param("id") int id); |
| | | String selectPlanUrlPlanIdName(@Param("id") int id); |
| | | Long selectPlanUrlPlanIdSize(@Param("id") int id); |
| | | String selectPlanUrlPlanIdUserName(@Param("id") int id); |
| | | List<Integer> selectPlanUrlId(@Param("planId") int planId); |
| | | |
| | | Plan selectPlanByNewestUuid(@Param("hostId") Long hostId); |
| | | |
| | | List<Plan> listByPage(Page<Plan> page, @Param("hostId")Long hostId, @Param("deptId") String deptId, @Param("userId") Long userId ,@Param("director")Long director, @Param("condition") String condition); |
New file |
| | |
| | | package com.zy.crm.manager.mapper; |
| | | |
| | | import com.zy.crm.manager.entity.PlanUrl; |
| | | import com.baomidou.mybatisplus.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springframework.stereotype.Repository; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Mapper |
| | | @Repository |
| | | public interface PlanUrlMapper extends BaseMapper<PlanUrl> { |
| | | |
| | | List<Integer> selectPlanUrlIdByPlanId(@Param("planId") Long planId); |
| | | List<Integer> selectPlanUrlIdByPlanId2(@Param("planId") Long planId,@Param("type") int type,@Param("hideUrl") int hideUrl); |
| | | List<PlanUrl> selectPlanUrlByPlanId(@Param("planId") Long planId); |
| | | List<PlanUrl> selectPlanUrlByPlanId2(@Param("planId") Long planId,@Param("type") int type,@Param("hideUrl") int hideUrl); |
| | | } |
| | |
| | | public interface PlanService extends IService<Plan> { |
| | | |
| | | Plan selectByUuid(Long hostId, String uuid); |
| | | void increasePlanUrl(int planId, String url,String name,Long size,String userName,Long userId); |
| | | String selectPlanUrlPlanIdUrl(int planId); |
| | | String selectPlanUrlPlanIdName(int planId); |
| | | Long selectPlanUrlPlanIdSize(int planId); |
| | | String selectPlanUrlPlanIdUserName(int planId); |
| | | List<Integer> selectPlanUrlId(int planId); |
| | | |
| | | String getUuid(Long hostId); |
| | | |
New file |
| | |
| | | package com.zy.crm.manager.service; |
| | | |
| | | import com.zy.crm.manager.entity.PlanUrl; |
| | | import com.baomidou.mybatisplus.service.IService; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | public interface PlanUrlService extends IService<PlanUrl> { |
| | | |
| | | List<Integer> selectPlanUrlIdByPlanId(Long planId); |
| | | List<Integer> selectPlanUrlIdByPlanId(Long planId,int type,int hideUrl); |
| | | List<PlanUrl> selectPlanUrlByPlanId(Long planId); |
| | | List<PlanUrl> selectPlanUrlByPlanId(Long planId,int type,int hideUrl); |
| | | |
| | | } |
| | |
| | | } |
| | | |
| | | @Override |
| | | public void increasePlanUrl(int planId, String url,String name,Long size,String userName,Long userId) { |
| | | this.baseMapper.increasePlanUrl(planId, url,name,size,userName,userId); |
| | | } |
| | | |
| | | @Override |
| | | public List<Integer> selectPlanUrlId(int planId) { |
| | | return this.baseMapper.selectPlanUrlId(planId); |
| | | } |
| | | |
| | | @Override |
| | | public String selectPlanUrlPlanIdUrl(int id) { |
| | | return this.baseMapper.selectPlanUrlPlanIdUrl(id); |
| | | } |
| | | |
| | | @Override |
| | | public String selectPlanUrlPlanIdName(int id) { |
| | | return this.baseMapper.selectPlanUrlPlanIdName(id); |
| | | } |
| | | |
| | | @Override |
| | | public Long selectPlanUrlPlanIdSize(int id) { |
| | | return this.baseMapper.selectPlanUrlPlanIdSize(id); |
| | | } |
| | | |
| | | @Override |
| | | public String selectPlanUrlPlanIdUserName(int id) { |
| | | return this.baseMapper.selectPlanUrlPlanIdUserName(id); |
| | | } |
| | | |
| | | |
| | | @Override |
| | | public String getUuid(Long hostId) { |
| | | String uuid = null; |
| | | int times = 0; |
New file |
| | |
| | | package com.zy.crm.manager.service.impl; |
| | | |
| | | import com.zy.crm.manager.mapper.PlanUrlMapper; |
| | | import com.zy.crm.manager.entity.PlanUrl; |
| | | import com.zy.crm.manager.service.PlanUrlService; |
| | | import com.baomidou.mybatisplus.service.impl.ServiceImpl; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.List; |
| | | |
| | | @Service("planUrlService") |
| | | public class PlanUrlServiceImpl extends ServiceImpl<PlanUrlMapper, PlanUrl> implements PlanUrlService { |
| | | |
| | | @Override |
| | | public List<Integer> selectPlanUrlIdByPlanId(Long planId) { |
| | | return this.baseMapper.selectPlanUrlIdByPlanId(planId); |
| | | } |
| | | @Override |
| | | public List<Integer> selectPlanUrlIdByPlanId(Long planId,int type,int hideUrl) { |
| | | return this.baseMapper.selectPlanUrlIdByPlanId2(planId,type,hideUrl); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlanUrl> selectPlanUrlByPlanId(Long planId) { |
| | | return this.baseMapper.selectPlanUrlByPlanId(planId); |
| | | } |
| | | |
| | | @Override |
| | | public List<PlanUrl> selectPlanUrlByPlanId(Long planId,int type,int hideUrl) { |
| | | return this.baseMapper.selectPlanUrlByPlanId2(planId,type,hideUrl); |
| | | } |
| | | |
| | | } |
| | |
| | | name: @pom.build.finalName@ |
| | | datasource: |
| | | driver-class-name: com.microsoft.sqlserver.jdbc.SQLServerDriver |
| | | # url: jdbc:sqlserver://192.168.4.15:1433;databasename=zy_crm |
| | | # username: sa |
| | | # password: sa@123 |
| | | url: jdbc:sqlserver://127.0.0.1:51433;databasename=zy_crm |
| | | url: jdbc:sqlserver://192.168.4.15:1433;databasename=zy_crm |
| | | username: sa |
| | | password: Zoneyung@zy56$ |
| | | password: sa@123 |
| | | # url: jdbc:sqlserver://127.0.0.1:51433;databasename=zy_crm |
| | | # username: sa |
| | | # password: Zoneyung@zy56$ |
| | | # url: jdbc:sqlserver://47.97.1.152:51433;databasename=zy_crm |
| | | # username: sa |
| | | # password: Zoneyung@zy56$ |
| | |
| | | ORDER BY mp.create_time DESC |
| | | </select> |
| | | |
| | | <select id="selectPlanUrlPlanIdUrl" resultType="java.lang.String"> |
| | | select url from man_plan_url |
| | | where 1=1 |
| | | and id=#{id} |
| | | </select> |
| | | |
| | | <select id="selectPlanUrlPlanIdName" resultType="java.lang.String"> |
| | | select name from man_plan_url |
| | | where 1=1 |
| | | and id=#{id} |
| | | </select> |
| | | |
| | | <select id="selectPlanUrlPlanIdSize" resultType="java.lang.Long"> |
| | | select file_size from man_plan_url |
| | | where 1=1 |
| | | and id=#{id} |
| | | </select> |
| | | |
| | | <select id="selectPlanUrlPlanIdUserName" resultType="java.lang.String"> |
| | | select user_name from man_plan_url |
| | | where 1=1 |
| | | and id=#{id} |
| | | </select> |
| | | |
| | | <select id="selectPlanUrlId" resultType="java.lang.Integer"> |
| | | select id from man_plan_url |
| | | where 1=1 |
| | | and plan_id=#{planId} |
| | | </select> |
| | | |
| | | <insert id="increasePlanUrl"> |
| | | insert into man_plan_url(plan_id,url,name,file_size,user_name,user_id) |
| | | values(#{planId},#{url},#{name},#{size},#{userName},#{userId}) |
| | | </insert> |
| | | |
| | | |
| | | </mapper> |
New file |
| | |
| | | <?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.zy.crm.manager.mapper.PlanUrlMapper"> |
| | | |
| | | <!-- 通用查询映射结果 --> |
| | | <resultMap id="BaseResultMap" type="com.zy.crm.manager.entity.PlanUrl"> |
| | | <id column="id" property="id" /> |
| | | <result column="plan_id" property="planId" /> |
| | | <result column="url" property="url" /> |
| | | <result column="name" property="name" /> |
| | | <result column="file_size" property="fileSize" /> |
| | | <result column="user_name" property="userName" /> |
| | | <result column="user_id" property="userId" /> |
| | | <result column="type" property="type" /> |
| | | <result column="hide_url" property="hideUrl" /> |
| | | <result column="status" property="status" /> |
| | | |
| | | </resultMap> |
| | | |
| | | <select id="selectPlanUrlIdByPlanId" resultType="java.lang.Integer"> |
| | | select id from man_plan_url |
| | | where 1=1 |
| | | and plan_id=#{planId} |
| | | </select> |
| | | |
| | | <select id="selectPlanUrlIdByPlanId2" resultType="java.lang.Integer"> |
| | | select id from man_plan_url |
| | | where 1=1 |
| | | and plan_id=#{planId} |
| | | and type = #{type} |
| | | and hide_url = #{hideUrl} |
| | | </select> |
| | | |
| | | <select id="selectPlanUrlByPlanId" resultMap="BaseResultMap"> |
| | | select * from man_plan_url |
| | | where 1=1 |
| | | and plan_id=#{planId} |
| | | </select> |
| | | |
| | | <select id="selectPlanUrlByPlanId2" resultMap="BaseResultMap"> |
| | | select * from man_plan_url |
| | | where 1=1 |
| | | and plan_id=#{planId} |
| | | and type = #{type} |
| | | and hide_url = #{hideUrl} |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | $("#upload-filename-id-" + file.lastModified).html(filename) |
| | | let token = localStorage.getItem("token"); |
| | | $.ajax({ |
| | | url: baseUrl+"/plan/insert/file/auth", |
| | | url: baseUrl+"/plan/url/insert/file/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | 'planId': $('.layui-layer-title').text(), |
| | |
| | | }); |
| | | // 获取路径下的文件列表,使用 jQuery 的 ajax 方法 |
| | | $.ajax({ |
| | | url: '/plan/view/file/auth', |
| | | url: '/plan/url/view/file/auth', |
| | | data:{ |
| | | planId:planIdSign |
| | | }, |
| | |
| | | $("#upload-filename-id-" + file.lastModified).html(filename) |
| | | let token = localStorage.getItem("token"); |
| | | $.ajax({ |
| | | url: baseUrl+"/plan/insert/file/auth", |
| | | url: baseUrl+"/plan/url/insert/file/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | 'planId': $('.layui-layer-title').text(), |
| | |
| | | }); |
| | | // 获取路径下的文件列表,使用 jQuery 的 ajax 方法 |
| | | $.ajax({ |
| | | url: '/plan/view/file/auth', |
| | | url: '/plan/url/view/file/auth', |
| | | data:{ |
| | | planId:planIdSign |
| | | }, |
| | |
| | | $("#upload-filename-id-" + file.lastModified).html(filename) |
| | | let token = localStorage.getItem("token"); |
| | | $.ajax({ |
| | | url: baseUrl+"/plan/insert/file/auth", |
| | | url: baseUrl+"/plan/url/insert/file/auth", |
| | | headers: {'token': localStorage.getItem('token')}, |
| | | data: { |
| | | 'planId': $('.layui-layer-title').text(), |
| | |
| | | }); |
| | | // 获取路径下的文件列表,使用 jQuery 的 ajax 方法 |
| | | $.ajax({ |
| | | url: '/plan/view/file/auth', |
| | | url: '/plan/url/view/file/auth', |
| | | data:{ |
| | | planId:data.itemId |
| | | }, |