tangzy
2021-09-03 fdc3fe8b7e0cf97b225ecc9135a05f4bb2090518
1.注册
13 files modified
1 files added
130 ■■■■ changed files
src/main/java/org/springblade/common/constant/FtpConstant.java 28 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/common/vo/DeptVo.java 15 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/FTP/OutJson.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/permit/controller/PermitController.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/record/controller/RecordController.java 4 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/DeptMapper.java 7 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/DeptMapper.xml 5 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/mapper/RoleMapper.xml 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/service/IDeptService.java 3 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/system/service/impl/DeptServiceImpl.java 6 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/zc/controller/ZcController.java 35 ●●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/zc/entity/Zc.java 1 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/zc/mapper/ZcMapper.xml 14 ●●●● patch | view | raw | blame | history
src/main/java/org/springblade/modules/zc/vo/ZcVO.java 2 ●●● patch | view | raw | blame | history
src/main/java/org/springblade/common/constant/FtpConstant.java
@@ -8,22 +8,22 @@
    /**
     * sql connect
     */
    //String sql_connect_dev = "jdbc:mysql://223.82.109.183:2083/zhbaw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true";
    String sql_connect_dev = "jdbc:mysql://223.82.109.183:2083/zhbaw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true";
    /**
     * sql connect
     */
    String sql_connect_dev = "jdbc:mysql://localhost:2083/zhbaw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true";
    //String sql_connect_dev = "jdbc:mysql://localhost:2083/zhbaw?useSSL=false&useUnicode=true&characterEncoding=utf-8&zeroDateTimeBehavior=convertToNull&transformedBitIsBoolean=true&serverTimezone=GMT%2B8&nullCatalogMeansCurrent=true&allowPublicKeyRetrieval=true";
    /**
     * ftp服务器IP地址
     */
    //String ftpHost_dev = "192.168.0.108";
    String ftpHost_dev = "192.168.0.108";
    /**
     * ftp服务器IP地址
     */
    String ftpHost_dev = "172.19.1.30";
    //String ftpHost_dev = "172.19.1.30";
    /**
     * ftp服务器端口
@@ -33,32 +33,32 @@
    /**
     * ftp服务器用户名
     */
    String ftpUserName = "yly";
    //String ftpUserName = "anonymous";
    //String ftpUserName = "yly";
    String ftpUserName = "anonymous";
    /**
     * ftp服务器密码
     */
    String ftpPassword = "Yly@123";
    //String ftpPassword = "";
    //String ftpPassword = "Yly@123";
    String ftpPassword = "";
    /**
     * ftp服务器路径
     */
    String ftpPath = "yly/anbao/";
    //String ftpPath = "anbao/";
    //String ftpPath = "yly/anbao/";
    String ftpPath = "anbao/";
    /**
     * 本地路径
     */
    String localPath = "/home/zhongsong/anbao/";
    //String localPath = "D:\\anbao\\";
    //String localPath = "/home/zhongsong/anbao/";
    String localPath = "D:\\anbao\\";
    //minio内网ip
    String ip = "http://47.49.21.216:9000";
    //String ip = "http://223.82.109.183:2081";
    //String ip = "http://47.49.21.216:9000";
    String ip = "http://223.82.109.183:2081";
    String jsonUrl = "/home/zhongsong/anbao/";
    //String jsonUrl = "D:\\anbao\\";
src/main/java/org/springblade/common/vo/DeptVo.java
New file
@@ -0,0 +1,15 @@
package org.springblade.common.vo;
import lombok.Data;
import java.io.Serializable;
/**
 * 部门
 */
@Data
public class DeptVo implements Serializable {
    private Long id;
    private String deptName;
}
src/main/java/org/springblade/modules/FTP/OutJson.java
@@ -154,7 +154,7 @@
     * @return
     */
    public static String TestJson(String fileName){
        //File file = new File("D:\\anbao\\"+fileName);
        //File file = new File(FtpConstant.jsonUrl+fileName);
        File file = new File(FtpConstant.jsonUrl +fileName);
        StringBuilder localStrBulider = new StringBuilder();
        if(file.isFile() && file.exists()) {
src/main/java/org/springblade/modules/permit/controller/PermitController.java
@@ -146,14 +146,12 @@
        permit.setStorage("1");
        permit.setPermitime(new Date());
        permitService.save(permit);
        String formatStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(permit.getEstablishtime());
        String pertime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(permit.getPermitime());
        String s = "insert into sys_permit(id,creditCode,enterpriseName,representative,establishTime," +
        String s = "insert into sys_permit(id,creditCode,enterpriseName,representative," +
            "registeredCapital,organizationCode,registrationNumber,identificationNumber,enterprises," +
            "address,business,region,registration,industry,type,permitime,deptid,ptype,representativecell,contacts,contactscell,jurisdiction,cardid)" +
            "values(" + "'" + permit.getId() + "'" + "," + "'" + permit.getCreditcode() + "'" + "," + "'" + permit.getEnterprisename() + "'" + "," + "'"
            + permit.getRepresentative() + "'" + "," +
            "'" + formatStr + "'" + "," + "'" + permit.getRegisteredcapital() + "'" + "," + "'"
            + permit.getRepresentative() + "'" + "," +"'" + permit.getRegisteredcapital() + "'" + "," + "'"
            + permit.getOrganizationcode() + "'" + "," + "'" + permit.getRegistrationnumber() + "'" + "," +
            "'" + permit.getIdentificationnumber() + "'" + "," + "'" + permit.getEnterprises() + "'" + "," + "'" +
            permit.getAddress() + "'" + "," + "'" + permit.getBusiness() + "'" + "," + "'" +
src/main/java/org/springblade/modules/record/controller/RecordController.java
@@ -123,14 +123,12 @@
        record.setType("2");
        record.setPermitime(new Date());
        recordService.save(record);
        String formatStr = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(record.getEstablishtime());
        String offtime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(record.getOfficetime());
        String pertime = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(record.getPermitime());
        String s = "insert into sys_record(id,creditCode,enterpriseName,representative,establishtime," +
            "registeredCapital,organizationCode,registrationNumber,identificationNumber,enterprises," +
            "address,business,region,registration,industry,type,permitime,deptid,ptype,representativecell,contacts,contactscell,perid,offices,officetime,jurisdiction,cardid)" +
            "values(" + "'" + record.getId() + "'" + "," + "'" + record.getCreditcode() + "'" + "," + "'" + record.getEnterprisename() + "'" + "," + "'"+ record.getRepresentative() + "'" + "," +
            "'" + formatStr + "'" + "," + "'" + record.getRegisteredcapital() + "'" + "," + "'"
            "values(" + "'" + record.getId() + "'" + "," + "'" + record.getCreditcode() + "'" + "," + "'" + record.getEnterprisename() + "'" + "," + "'"+ record.getRepresentative() + "'" + "," + "'" + record.getRegisteredcapital() + "'" + "," + "'"
            + record.getOrganizationcode() + "'" + "," + "'" + record.getRegistrationnumber() + "'" + "," +
            "'" + record.getIdentificationnumber() + "'" + "," + "'" + record.getEnterprises() + "'" + "," + "'" +
            record.getAddress() + "'" + "," + "'" + record.getBusiness() + "'" + "," + "'" +
src/main/java/org/springblade/modules/system/mapper/DeptMapper.java
@@ -20,6 +20,7 @@
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.MapKey;
import org.apache.ibatis.annotations.Param;
import org.springblade.common.vo.DeptVo;
import org.springblade.modules.system.entity.Dept;
import org.springblade.modules.system.node.TreeNodes;
import org.springblade.modules.system.vo.DeptVO;
@@ -90,7 +91,11 @@
     */
    List<DeptVO> securityLazyTree(String jurisdiction, Long parentId);
    List<DeptVO>  selectInfo();
    /**
     * 查询所有的部门信息
     * @return
     */
    List<DeptVo> selDeptList();
    /**
     * 懒加载获取部门树形结构(包含用户数据)
     * @return
src/main/java/org/springblade/modules/system/mapper/DeptMapper.xml
@@ -603,4 +603,9 @@
          and dept.id !=1420222961377357825
        and dept.parent_id!=1420222961377357825
    </select>
    <!--查询所有的部门信息-->
    <select id="selDeptList" resultType="org.springblade.common.vo.DeptVo">
        select id ,dept_name deptName from blade_dept where is_deleted=0
    </select>
</mapper>
src/main/java/org/springblade/modules/system/mapper/RoleMapper.xml
@@ -27,7 +27,7 @@
    </select>
    <select id="tree" resultMap="treeNodeResultMap">
        select id, parent_id, role_name as title, id as "value", id as "key" from blade_role where is_deleted = 0
        select id, parent_id, role_name as title, id as "value", id as "key" from blade_role where is_deleted = 0 AND id!=1123598816738675201
        <if test="param1!=null">
            and tenant_id = #{param1}
        </if>
src/main/java/org/springblade/modules/system/service/IDeptService.java
@@ -17,6 +17,7 @@
package org.springblade.modules.system.service;
import com.baomidou.mybatisplus.extension.service.IService;
import org.springblade.common.vo.DeptVo;
import org.springblade.modules.system.entity.Dept;
import org.springblade.modules.system.node.TreeNodes;
import org.springblade.modules.system.vo.DeptVO;
@@ -132,7 +133,7 @@
     */
    List<DeptVO> securityLazyTree(String jurisdiction, Long parentId);
    List<DeptVO> selectInfo();
    List<DeptVo> selDeptList();
    /**
     * 懒加载获取部门树形结构(包含用户数据)
     * @return
src/main/java/org/springblade/modules/system/service/impl/DeptServiceImpl.java
@@ -21,6 +21,7 @@
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import lombok.AllArgsConstructor;
import org.springblade.common.cache.SysCache;
import org.springblade.common.vo.DeptVo;
import org.springblade.core.log.exception.ServiceException;
import org.springblade.core.mp.support.Condition;
import org.springblade.core.secure.utils.AuthUtil;
@@ -294,4 +295,9 @@
    public List<DeptVO> selectInfo() {
        return ForestNodeMerger.merge(baseMapper.selectInfo());
    }
    @Override
    public List<DeptVo> selDeptList() {
        return baseMapper.selDeptList();
    }
}
src/main/java/org/springblade/modules/zc/controller/ZcController.java
@@ -22,22 +22,29 @@
import io.swagger.annotations.ApiOperation;
import io.swagger.annotations.ApiParam;
import lombok.AllArgsConstructor;
import org.springblade.common.vo.DeptVo;
import org.springblade.core.boot.ctrl.BladeController;
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.DigestUtil;
import org.springblade.core.tool.utils.Func;
import org.springblade.modules.information.entity.Information;
import org.springblade.modules.system.entity.User;
import org.springblade.modules.system.service.IDeptService;
import org.springblade.modules.system.service.IUserService;
import org.springblade.modules.zc.entity.Zc;
import org.springblade.modules.zc.service.IZcService;
import org.springblade.modules.zc.vo.ZcVO;
import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import javax.validation.Valid;
import java.text.SimpleDateFormat;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
import java.util.Map;
/**
 *  控制器
@@ -54,6 +61,8 @@
    private final IZcService zcService;
    private IUserService iUserService;
    private final IDeptService deptFeignApi;
    /**
     * 详情
@@ -84,8 +93,27 @@
    @ApiOperationSupport(order = 3)
    @ApiOperation(value = "分页", notes = "传入zc")
    public R<IPage<ZcVO>> page(ZcVO zc, Query query) {
        IPage<ZcVO> pages = zcService.selectZcPage(Condition.getPage(query), zc);
        return R.data(pages);
        //获取部门数据
        List<DeptVo> deptVos = deptFeignApi.selDeptList();
        IPage<ZcVO> page = zcService.selectZcPage(Condition.getPage(query), zc);
        for (int j = 0; j < page.getRecords().size(); j++) {
            if (page.getRecords().get(j).getDeptid() != null && !page.getRecords().get(j).getDeptid().equals("")){
                String[] split = page.getRecords().get(j).getDeptid().split(",");
                List<String> list = Arrays.asList(split);
                StringBuffer deptNameBuiffer = new StringBuffer();
                //数据匹配封装
                for (String deptId:list) {
                    for (DeptVo deptVo:deptVos) {
                        if (deptId.equals(deptVo.getId().toString())){
                            deptNameBuiffer.append(deptVo.getDeptName()).append(",");
                        }
                    }
                }
                //封装部门名称数据
                page.getRecords().get(j).setDeptName(deptNameBuiffer.substring(0,deptNameBuiffer.length()-1));
            }
        }
        return R.data(page);
    }
    /**
@@ -112,10 +140,11 @@
        if (type.equals("1")){
            User user = new User();
            user.setAccount(zc.getUsername());
            user.setTenantId("000000");
            user.setPassword(DigestUtil.encrypt(zc.getPassword()));
            user.setRealName(zc.getSname());
            user.setCardid(zc.getCardid());
            user.setRoleId("1433232531179704321");
            user.setRoleId(zc.getParentId());
            user.setDeptId(zc.getDeptid());
            iUserService.saveOrUpdate(user);
        }
src/main/java/org/springblade/modules/zc/entity/Zc.java
@@ -74,6 +74,7 @@
    @ApiModelProperty(value = "审核状态")
    private String type;
    private String deptid;
    private String parentId;
}
src/main/java/org/springblade/modules/zc/mapper/ZcMapper.xml
@@ -3,7 +3,7 @@
<mapper namespace="org.springblade.modules.zc.mapper.ZcMapper">
    <!-- 通用查询映射结果 -->
    <resultMap id="zcResultMap" type="org.springblade.modules.zc.entity.Zc">
    <resultMap id="zcResultMap" type="org.springblade.modules.zc.vo.ZcVO">
        <id column="id" property="id"/>
        <result column="username" property="username"/>
        <result column="password" property="password"/>
@@ -13,6 +13,7 @@
        <result column="zctime" property="zctime"/>
        <result column="type" property="type"/>
        <result column="deptid" property="deptid"/>
        <result column="parentId" property="parentId"/>
    </resultMap>
@@ -23,13 +24,18 @@
        z.sname,
        z.cardid,
        z.type,
        d.dept_name AS deptid
        z.deptid
        FROM
        act_zc z
        LEFT JOIN blade_dept d ON d.id = z.deptid where 1=1
        act_zc z where 1=1
        <if test="zc.type!=null and zc.type!=''">
            and z.type=#{zc.type}
        </if>
        <if test="zc.sname!=null and zc.sname!=''">
            and z.sname like concat(concat('%', #{zc.sname}),'%')
        </if>
        <if test="zc.username!=null and zc.username!=''">
            and z.username like concat(concat('%', #{zc.username}),'%')
        </if>
    </select>
src/main/java/org/springblade/modules/zc/vo/ZcVO.java
@@ -32,5 +32,5 @@
@ApiModel(value = "ZcVO对象", description = "ZcVO对象")
public class ZcVO extends Zc {
    private static final long serialVersionUID = 1L;
    private String deptName;
}