1. 辖区tree 接口新增修改
2. 材料上传接口修改,去除licet_id
3. 材料展示接口修改,对接大数据平台,通过读取请求头参数来返回相应的请求参数
| | |
| | | import org.springblade.modules.jurisdiction.service.JurisdictionService; |
| | | import org.springblade.modules.jurisdiction.vo.JurisdictionVO; |
| | | import org.springblade.modules.jurisdiction.wrapper.JurisdictionWrapper; |
| | | import org.springblade.modules.system.node.TreeNode; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import springfox.documentation.annotations.ApiIgnore; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.validation.Valid; |
| | | import java.util.ArrayList; |
| | | import java.util.Arrays; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | } |
| | | |
| | | /** |
| | | * 辖区树(对接大数据平台) |
| | | */ |
| | | @GetMapping("/jurisdiction_lazy-tree") |
| | | public R jurisdictionLazyTree(HttpServletRequest request) { |
| | | String fieldNames = request.getHeader("_fieldNames"); |
| | | List<String> asList = new ArrayList<>(); |
| | | if (null!= fieldNames && !fieldNames.equals("")) { |
| | | //去除头尾 |
| | | String fieldString = fieldNames.substring(1, fieldNames.length() - 1); |
| | | asList = Arrays.asList(fieldString.split(",")); |
| | | } |
| | | List<TreeNode> tree = jurisdictionService.jurisdictionLazyTree(); |
| | | return R.data(tree); |
| | | } |
| | | |
| | | /** |
| | | * 新增或修改 |
| | | */ |
| | | @PostMapping("/submit") |
| | |
| | | */ |
| | | package org.springblade.modules.jurisdiction.mapper; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.SqlParser; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import org.apache.ibatis.annotations.MapKey; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.jurisdiction.entity.Jurisdiction; |
| | | import org.springblade.modules.jurisdiction.vo.JurisdictionVO; |
| | | import org.springblade.modules.system.node.TreeNode; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | List<String> getDeptNames(Long[] ids); |
| | | String selJur(String deptname); |
| | | |
| | | /** |
| | | * 懒加载获取树形节点 |
| | | * @return |
| | | */ |
| | | @MapKey(value = "id") |
| | | @SqlParser(filter=true) |
| | | Map<Long, TreeNode> jurisdictionLazyTree(); |
| | | } |
| | |
| | | WHERE dept.is_deleted = 0 |
| | | </select> |
| | | |
| | | <select id="jurisdictionLazyTree" resultType="org.springblade.modules.system.node.TreeNode"> |
| | | SELECT |
| | | sj.id, |
| | | sj.parent_id as parentId, |
| | | sj.dept_name AS name, |
| | | ( |
| | | SELECT |
| | | CASE WHEN count(1) > 0 THEN 1 ELSE 0 END |
| | | FROM |
| | | sys_jurisdiction |
| | | WHERE |
| | | parent_id = sj.id and is_deleted = 0 |
| | | ) AS "has_children" |
| | | FROM |
| | | sys_jurisdiction sj |
| | | WHERE sj.is_deleted = 0 |
| | | </select> |
| | | |
| | | |
| | | <select id="selJur" resultType="java.lang.String"> |
| | | SELECT id FROM sys_jurisdiction WHERE dept_name=#{deptname} |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import org.springblade.modules.jurisdiction.entity.Jurisdiction; |
| | | import org.springblade.modules.jurisdiction.vo.JurisdictionVO; |
| | | import org.springblade.modules.system.node.TreeNode; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | |
| | | */ |
| | | boolean submit(Jurisdiction jurisdiction); |
| | | String selJur(String deptname); |
| | | |
| | | /** |
| | | * 查询tree 数据 |
| | | * @return |
| | | */ |
| | | List<TreeNode> jurisdictionLazyTree(); |
| | | } |
| | |
| | | import org.springblade.modules.jurisdiction.mapper.JurisdictionMapper; |
| | | import org.springblade.modules.jurisdiction.service.JurisdictionService; |
| | | import org.springblade.modules.jurisdiction.vo.JurisdictionVO; |
| | | import org.springblade.modules.system.node.TreeNode; |
| | | import org.springframework.stereotype.Service; |
| | | |
| | | import java.util.ArrayList; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | |
| | | return baseMapper.selJur(deptname); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 查询tree 数据 |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<TreeNode> jurisdictionLazyTree() { |
| | | Map<Long, TreeNode> map = baseMapper.jurisdictionLazyTree(); |
| | | List<TreeNode> tree = new ArrayList<>(); |
| | | map.forEach((id, treeNode) -> { |
| | | if (map.containsKey(treeNode.getParentId())) { |
| | | map.get(treeNode.getParentId()).getChildren().add(treeNode); |
| | | } else { |
| | | tree.add(treeNode); |
| | | } |
| | | }); |
| | | return tree; |
| | | } |
| | | } |
| | |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.springblade.core.mp.support.Condition; |
| | | import org.springblade.core.mp.support.Query; |
| | | import org.springblade.core.tool.api.R; |
| | | import org.springblade.core.tool.utils.Func; |
| | | import org.springblade.core.tool.utils.WebUtil; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import org.springblade.modules.licet.entity.Licet; |
| | | import org.springblade.modules.licet.vo.LicetVO; |
| | | import org.springblade.modules.licet.service.ILicetService; |
| | | import org.springblade.core.boot.ctrl.BladeController; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.util.*; |
| | | |
| | | /** |
| | | * 控制器 |
| | |
| | | } |
| | | |
| | | /** |
| | | * 自定义分页 |
| | | */ |
| | | @GetMapping("/lists") |
| | | public R lists(LicetVO licet, Query query, HttpServletRequest request){ |
| | | String fieldNames = WebUtil.getRequest().getParameter("_fieldNames"); |
| | | // String fieldNames = request.getHeader("_fieldNames"); |
| | | System.out.println("fieldNames = " + fieldNames); |
| | | List<String> asList = new ArrayList<>(); |
| | | if (null!= fieldNames && !fieldNames.equals("")) { |
| | | //去除头尾 |
| | | String fieldString = fieldNames.substring(1, fieldNames.length() - 1); |
| | | asList = Arrays.asList(fieldString.split(",")); |
| | | } |
| | | List<Map<Object, Object>> list = licetService.selectLicetPages(licet,asList); |
| | | //返回 |
| | | return R.data(list); |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @PostMapping("/save") |
| | |
| | | */ |
| | | package org.springblade.modules.licet.mapper; |
| | | |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.springblade.modules.licet.entity.Licet; |
| | | import org.springblade.modules.licet.vo.LicetVO; |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * Mapper 接口 |
| | |
| | | * @param licet |
| | | * @return |
| | | */ |
| | | List<LicetVO> selectLicetPage(IPage page, LicetVO licet); |
| | | List<LicetVO> selectLicetPage(IPage page, @Param("licet") LicetVO licet); |
| | | |
| | | /** |
| | | * |
| | | * @param licet |
| | | * @return |
| | | */ |
| | | List<Map<Object, Object>> selectLicets(@Param("licet") LicetVO licet, |
| | | @Param("id") String id, |
| | | @Param("ptype") String ptype, |
| | | @Param("originalname") String originalname, |
| | | @Param("template") String template); |
| | | |
| | | } |
| | |
| | | |
| | | |
| | | <select id="selectLicetPage" resultMap="licetResultMap"> |
| | | select * from sys_licet where 1=1 order by id asc |
| | | select * from sys_licet where 1=1 |
| | | <if test="licet.ptype!=null and licet.ptype!=''"> |
| | | and ptype = #{licet.ptype} |
| | | </if> |
| | | order by id asc |
| | | </select> |
| | | |
| | | <select id="selectLicets" resultType="java.util.HashMap"> |
| | | select |
| | | <trim suffixOverrides="," > |
| | | <if test="id != null and id !=''" > |
| | | id, |
| | | </if> |
| | | <if test="ptype != null and ptype !=''" > |
| | | ptype, |
| | | </if> |
| | | <if test="originalname != null and originalname !=''" > |
| | | originalname, |
| | | </if> |
| | | <if test="template != null and template !=''" > |
| | | ifnull(template,"") template, |
| | | </if> |
| | | </trim> |
| | | from sys_licet |
| | | where 1=1 |
| | | <if test="licet.ptype!=null and licet.ptype!=''"> |
| | | and ptype = #{licet.ptype} |
| | | </if> |
| | | order by id asc |
| | | </select> |
| | | |
| | | </mapper> |
| | |
| | | import com.baomidou.mybatisplus.extension.service.IService; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 服务类 |
| | | * |
| | |
| | | */ |
| | | IPage<LicetVO> selectLicetPage(IPage<LicetVO> page, LicetVO licet); |
| | | |
| | | /** |
| | | * @param list |
| | | * @param licet |
| | | * @return |
| | | */ |
| | | List<Map<Object, Object>> selectLicetPages(LicetVO licet, List<String> list); |
| | | |
| | | } |
| | |
| | | import org.springframework.stereotype.Service; |
| | | import com.baomidou.mybatisplus.core.metadata.IPage; |
| | | |
| | | import java.lang.reflect.Field; |
| | | import java.util.ArrayList; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 服务实现类 |
| | | * |
| | |
| | | return page.setRecords(baseMapper.selectLicetPage(page, licet)); |
| | | } |
| | | |
| | | /** |
| | | * @param list |
| | | * @param licet |
| | | * @return |
| | | */ |
| | | @Override |
| | | public List<Map<Object, Object>> selectLicetPages(LicetVO licet,List<String> list){ |
| | | String id = ""; |
| | | String ptype = ""; |
| | | String originalname = ""; |
| | | String template = ""; |
| | | if (list.size()>0){ |
| | | for (String s : list) { |
| | | if (s.equals("id")){ |
| | | id = "id"; |
| | | } |
| | | if (s.equals("originalname")){ |
| | | originalname = "originalname"; |
| | | } |
| | | if (s.equals("ptype")){ |
| | | ptype = "ptype"; |
| | | } |
| | | if (s.equals("template")){ |
| | | template = "template"; |
| | | } |
| | | } |
| | | } |
| | | //查询 |
| | | List<Map<Object, Object>> licets = baseMapper.selectLicets(licet,id,ptype,originalname,template); |
| | | return licets; |
| | | } |
| | | |
| | | } |
| | |
| | | import io.swagger.annotations.ApiParam; |
| | | import com.github.xiaoymin.knife4j.annotations.ApiOperationSupport; |
| | | import lombok.AllArgsConstructor; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.validation.Valid; |
| | | |
| | | import org.apache.commons.lang3.StringUtils; |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/liceUpload") |
| | | public R liceUpload(@RequestParam MultipartFile file, String licetId, String ptype, String cardid) throws IOException, InvalidResponseException, InvalidKeyException, NoSuchAlgorithmException, ServerException, ErrorResponseException, XmlParserException, InsufficientDataException, InternalException { |
| | | public R liceUpload(@RequestParam MultipartFile file, String licetId, String ptype, String cardid, HttpServletRequest request) throws IOException, InvalidResponseException, InvalidKeyException, NoSuchAlgorithmException, ServerException, ErrorResponseException, XmlParserException, InsufficientDataException, InternalException { |
| | | String fieldNames = request.getHeader("_fieldNames"); |
| | | System.out.println("fieldNames = " + fieldNames); |
| | | //文件上传 |
| | | String urls = putFile(file); |
| | | String link = urls.split(",")[0]; |
| | |
| | | |
| | | Licet licet = new Licet(); |
| | | licet.setPtype(ptype); |
| | | //查看当前模板是第几个 |
| | | List<Licet> list = licetService.list(Condition.getQueryWrapper(licet)); |
| | | Integer index = 0; |
| | | if (list.size()>0){ |
| | | for (int i = 0; i < list.size(); i++) { |
| | | if (list.get(i).getId().equals(Integer.parseInt(licetId))){ |
| | | index = i; |
| | | } |
| | | } |
| | | } |
| | | licetuser.setUserid(cardid); |
| | | |
| | | |
| | | //查询上传的材料信息 |
| | | Licetuser licetuser1 = licetuserService.getOne(Condition.getQueryWrapper(licetuser)); |
| | | if (null==licetuser1){ |
| | | licetuser.setLicetId(licetId); |
| | | licetuser.setTemplateid(licetId); |
| | | licetuser.setLinks(link); |
| | | //设置下标 |
| | | licetuser.setTemplateid(index.toString()); |
| | | //新增 |
| | | licetuserService.save(licetuser); |
| | | |
| | | //数据同步 |
| | | // String s1 = |
| | | // "insert into sys_licetuser(id,userid,ptype,templateid,links,licet_id) " + |
| | | // "values(" + "'" + licetuser.getId() + "'" + "," + |
| | | // "'" + licetuser.getUserid() + "'" + "," + |
| | | // "'" + licetuser.getPtype() + "'" + "," + |
| | | // "'" + licetuser.getTemplateid() + "'" + "," + |
| | | // "'" + inlink + "'" + "," + |
| | | // "'" + licetuser.getLicetId() + "'" + ")"; |
| | | // FtpUtil.sqlFileUpload(s1); |
| | | String s1 = |
| | | "insert into sys_licetuser(id,userid,ptype,templateid,links) " + |
| | | "values(" + "'" + licetuser.getId() + "'" + "," + |
| | |
| | | FtpUtil.sqlFileUpload(s1); |
| | | }else { |
| | | //判断是否是重复上传 |
| | | List<String> asList = Arrays.asList(licetuser1.getLicetId().split(",")); |
| | | List<String> asList = Arrays.asList(licetuser1.getTemplateid().split(",")); |
| | | List<String> linksList = Arrays.asList(licetuser1.getLinks().split(",")); |
| | | boolean status = asList.contains(licetId); |
| | | if(status) { |
| | |
| | | licetuser1.setLinks(StringUtils.join(linksList.toArray(), ",")); |
| | | }else { |
| | | //替换 下标集合,id集合,links |
| | | licetuser1.setTemplateid(licetuser1.getTemplateid()+","+index); |
| | | licetuser1.setLicetId(licetuser1.getLicetId()+","+licetId); |
| | | licetuser1.setTemplateid(licetuser1.getTemplateid()+","+licetId); |
| | | licetuser1.setLinks(licetuser1.getLinks()+","+link); |
| | | } |
| | | //修改 |
| | |
| | | String inlinks = url.substring(0, url.length() - 1); |
| | | |
| | | //同步数据 |
| | | // String s1 = "update sys_licetuser set userid = " + "'" + licetuser1.getUserid() + "'" + |
| | | // ",ptype = " + "'" + licetuser1.getPtype() + "'" + |
| | | // ",templateid = " + "'" + licetuser1.getTemplateid() + "'" + |
| | | // ",links = " + "'" + inlinks + "'" + |
| | | // ",licet_id = " + "'" + licetuser1.getLicetId() + "'" + |
| | | // " " + "where id = " + "'" + licetuser1.getId() + "'"; |
| | | // FtpUtil.sqlFileUpload(s1); |
| | | String s1 = "update sys_licetuser set userid = " + "'" + licetuser1.getUserid() + "'" + |
| | | ",ptype = " + "'" + licetuser1.getPtype() + "'" + |
| | | ",templateid = " + "'" + licetuser1.getTemplateid() + "'" + |
| | |
| | | */ |
| | | private String links; |
| | | |
| | | /** |
| | | * 以上传的文件id,关联模板id |
| | | */ |
| | | private String licetId; |
| | | |
| | | |
| | | } |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | import sun.net.www.http.HttpClient; |
| | | |
| | | import javax.servlet.http.HttpServletRequest; |
| | | import javax.validation.Valid; |
| | | import java.io.*; |
| | | import java.net.HttpURLConnection; |
| | |
| | | @PostMapping("/save") |
| | | @ApiOperationSupport(order = 4) |
| | | @ApiOperation(value = "新增", notes = "传入permit") |
| | | public R save(@Valid @RequestBody Permit permit) throws FileNotFoundException { |
| | | public R save(@Valid @RequestBody Permit permit){ |
| | | String cardid = permit.getCardid(); |
| | | String type = permit.getPtype(); |
| | | Map map = permitService.selectIn(cardid, type); |
| | |
| | | } |
| | | |
| | | /** |
| | | * 新增 |
| | | */ |
| | | @PostMapping("/saves") |
| | | public R saves(@Valid @RequestBody Permit permit, HttpServletRequest request){ |
| | | String fieldNames = request.getHeader("_fieldNames"); |
| | | String cardid = permit.getCardid(); |
| | | String type = permit.getPtype(); |
| | | Map map = permitService.selectIn(cardid, type); |
| | | if (map != null) { |
| | | String id = map.get("id").toString(); |
| | | permitService.removeByIds(Func.toLongList(id)); |
| | | } |
| | | permit.setType("2"); |
| | | permit.setStorage("1"); |
| | | permit.setPermitime(new Date()); |
| | | permitService.save(permit); |
| | | //String pertime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(permit.getPermitime()); |
| | | String overtime = new SimpleDateFormat("yyyy-MM-dd").format(permit.getOvertime()); |
| | | String s = "insert into sys_permit(id,creditCode,enterpriseName,representative," + |
| | | "registeredCapital,organizationCode,registrationNumber,identificationNumber,enterprises," + |
| | | "address,business,region,registration,industry,type,deptid,ptype,representativecell,contacts,contactscell,jurisdiction,cardid,overtime)" + |
| | | "values(" + "'" + permit.getId() + "'" + "," + "'" + permit.getCreditcode() + "'" + "," + "'" + permit.getEnterprisename() + "'" + "," + "'" |
| | | + permit.getRepresentative() + "'" + "," + "'" + permit.getRegisteredcapital() + "'" + "," + "'" |
| | | + permit.getOrganizationcode() + "'" + "," + "'" + permit.getRegistrationnumber() + "'" + "," + |
| | | "'" + permit.getIdentificationnumber() + "'" + "," + "'" + permit.getEnterprises() + "'" + "," + "'" + |
| | | permit.getAddress() + "'" + "," + "'" + permit.getBusiness() + "'" + "," + "'" + |
| | | permit.getRegion() + "'" + "," + "'" + permit.getRegistration() + "'" + "," + "'" + permit.getIndustry() + "'" + "," + "'" |
| | | + permit.getType() + "'" + "," + "'" + permit.getDeptid() + "'" + "," + "'" + permit.getPtype() + "'" + "," + |
| | | "'" + permit.getRepresentativecell() + "'" + "," + "'" + permit.getContacts() + "'" + "," + "'" |
| | | + permit.getContactscell() + "'" + "," + "'" + permit.getJurisdiction() + "'" + |
| | | "," + "'" + permit.getCardid() + "'" + "," + "'" + overtime + "'" + ")"; |
| | | FtpUtil.sqlFileUpload(s); |
| | | //返回 |
| | | return R.data(permit); |
| | | } |
| | | |
| | | /** |
| | | * 暂存 |
| | | */ |
| | | @PostMapping("/storage") |
| | |
| | | - /blade-system/dept/selectInfo |
| | | - /blade-user/zc |
| | | - /jurisdiction/lazy-trees |
| | | - /jurisdiction/jurisdiction_lazy-tree |
| | | - /blade-resource/oss/endpoint/put-files |
| | | - /qrCode/** |
| | | - /blade-resource/attach/detail |
| | |
| | | - /licetuser/list |
| | | - /permit/save |
| | | - /licet/list |
| | | - /licet/lists |
| | | |
| | | #授权认证配置 |
| | | auth: |