新增基础信息维护,企业信息相关
							parent
							
								
									f8ca58b378
								
							
						
					
					
						commit
						083d78d348
					
				@ -0,0 +1,36 @@
 | 
				
			||||
package com.glxp.api.controller.auth;
 | 
				
			||||
 | 
				
			||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 | 
				
			||||
import com.glxp.api.annotation.AuthRuleAnnotation;
 | 
				
			||||
import com.glxp.api.common.res.BaseResponse;
 | 
				
			||||
import com.glxp.api.common.util.ResultVOUtils;
 | 
				
			||||
import com.glxp.api.controller.BaseController;
 | 
				
			||||
import com.glxp.api.entity.auth.UserCompanyEntity;
 | 
				
			||||
import com.glxp.api.req.auth.FilterUserComapanyRequest;
 | 
				
			||||
import com.glxp.api.service.auth.UserCompanyService;
 | 
				
			||||
import lombok.extern.slf4j.Slf4j;
 | 
				
			||||
import org.springframework.web.bind.annotation.GetMapping;
 | 
				
			||||
import org.springframework.web.bind.annotation.RestController;
 | 
				
			||||
 | 
				
			||||
import javax.annotation.Resource;
 | 
				
			||||
import java.util.List;
 | 
				
			||||
 | 
				
			||||
@RestController
 | 
				
			||||
@Slf4j
 | 
				
			||||
public class UserComanyController extends BaseController {
 | 
				
			||||
 | 
				
			||||
    @Resource
 | 
				
			||||
    UserCompanyService userCompanyService;
 | 
				
			||||
 | 
				
			||||
 | 
				
			||||
    //    关键字搜索
 | 
				
			||||
    @AuthRuleAnnotation("")
 | 
				
			||||
    @GetMapping("udi/auth/user/comapny/search")
 | 
				
			||||
    public BaseResponse search(FilterUserComapanyRequest filterUserComapanyRequest) {
 | 
				
			||||
        //获取部门id
 | 
				
			||||
        List<UserCompanyEntity> userCompanyEntities = userCompanyService.list(new QueryWrapper<UserCompanyEntity>().like("companyName", filterUserComapanyRequest.getSearchKey())
 | 
				
			||||
                .or().like("creditNum", filterUserComapanyRequest.getSearchKey()));
 | 
				
			||||
        return ResultVOUtils.success(userCompanyEntities);
 | 
				
			||||
    }
 | 
				
			||||
 | 
				
			||||
}
 | 
				
			||||
@ -0,0 +1,9 @@
 | 
				
			||||
package com.glxp.api.dao.auth;
 | 
				
			||||
 | 
				
			||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 | 
				
			||||
import com.glxp.api.entity.auth.UserCompanyEntity;
 | 
				
			||||
import org.apache.ibatis.annotations.Mapper;
 | 
				
			||||
 | 
				
			||||
@Mapper
 | 
				
			||||
public interface UserCompanyMapper extends BaseMapper<UserCompanyEntity> {
 | 
				
			||||
}
 | 
				
			||||
@ -0,0 +1,9 @@
 | 
				
			||||
package com.glxp.api.dao.basic;
 | 
				
			||||
 | 
				
			||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 | 
				
			||||
import com.glxp.api.entity.basic.BasicUdiRelEntity;
 | 
				
			||||
import org.apache.ibatis.annotations.Mapper;
 | 
				
			||||
 | 
				
			||||
@Mapper
 | 
				
			||||
public interface BasicUdiRelEntityMapper extends BaseMapper<BasicUdiRelEntity> {
 | 
				
			||||
}
 | 
				
			||||
@ -0,0 +1,16 @@
 | 
				
			||||
package com.glxp.api.dao.basic;
 | 
				
			||||
 | 
				
			||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 | 
				
			||||
import com.glxp.api.entity.basic.BasicUdiRelEntity;
 | 
				
			||||
import com.glxp.api.req.basic.FilterUdiRelRequest;
 | 
				
			||||
import com.glxp.api.res.basic.BasicUdiRelResponse;
 | 
				
			||||
import org.apache.ibatis.annotations.Mapper;
 | 
				
			||||
 | 
				
			||||
import java.util.List;
 | 
				
			||||
 | 
				
			||||
@Mapper
 | 
				
			||||
public interface BasicUdiRelMapper extends BaseMapper<BasicUdiRelEntity> {
 | 
				
			||||
 | 
				
			||||
 | 
				
			||||
    List<BasicUdiRelResponse> filterList(FilterUdiRelRequest filterUdiRelRequest);
 | 
				
			||||
}
 | 
				
			||||
@ -0,0 +1,48 @@
 | 
				
			||||
package com.glxp.api.entity.basic;
 | 
				
			||||
 | 
				
			||||
import com.baomidou.mybatisplus.annotation.IdType;
 | 
				
			||||
import com.baomidou.mybatisplus.annotation.TableField;
 | 
				
			||||
import com.baomidou.mybatisplus.annotation.TableId;
 | 
				
			||||
import com.baomidou.mybatisplus.annotation.TableName;
 | 
				
			||||
import java.io.Serializable;
 | 
				
			||||
import java.util.Date;
 | 
				
			||||
import lombok.Data;
 | 
				
			||||
 | 
				
			||||
@Data
 | 
				
			||||
@TableName(value = "basic_udi_rel")
 | 
				
			||||
public class BasicUdiRelEntity implements Serializable {
 | 
				
			||||
    @TableId(value = "id", type = IdType.INPUT)
 | 
				
			||||
    private Long id;
 | 
				
			||||
 | 
				
			||||
    /**
 | 
				
			||||
     * 国家库uuid
 | 
				
			||||
     */
 | 
				
			||||
    @TableField(value = "uuid")
 | 
				
			||||
    private String uuid;
 | 
				
			||||
 | 
				
			||||
    /**
 | 
				
			||||
     * 企业信息ID外键
 | 
				
			||||
     */
 | 
				
			||||
    @TableField(value = "companyIdFk")
 | 
				
			||||
    private Long companyIdFk;
 | 
				
			||||
 | 
				
			||||
    /**
 | 
				
			||||
     * 更新时间
 | 
				
			||||
     */
 | 
				
			||||
    @TableField(value = "updateTime")
 | 
				
			||||
    private Date updateTime;
 | 
				
			||||
 | 
				
			||||
    /**
 | 
				
			||||
     * 备注
 | 
				
			||||
     */
 | 
				
			||||
    @TableField(value = "remark")
 | 
				
			||||
    private String remark;
 | 
				
			||||
 | 
				
			||||
    /**
 | 
				
			||||
     * 更新人
 | 
				
			||||
     */
 | 
				
			||||
    @TableField(value = "updateUser")
 | 
				
			||||
    private String updateUser;
 | 
				
			||||
 | 
				
			||||
    private static final long serialVersionUID = 1L;
 | 
				
			||||
}
 | 
				
			||||
@ -0,0 +1,11 @@
 | 
				
			||||
package com.glxp.api.req.auth;
 | 
				
			||||
 | 
				
			||||
import com.glxp.api.util.page.ListPageRequest;
 | 
				
			||||
import lombok.Data;
 | 
				
			||||
 | 
				
			||||
@Data
 | 
				
			||||
public class FilterUserComapanyRequest extends ListPageRequest {
 | 
				
			||||
 | 
				
			||||
    private String searchKey;
 | 
				
			||||
 | 
				
			||||
}
 | 
				
			||||
@ -0,0 +1,39 @@
 | 
				
			||||
package com.glxp.api.req.basic;
 | 
				
			||||
 | 
				
			||||
import com.baomidou.mybatisplus.annotation.IdType;
 | 
				
			||||
import com.baomidou.mybatisplus.annotation.TableField;
 | 
				
			||||
import com.baomidou.mybatisplus.annotation.TableId;
 | 
				
			||||
import lombok.Data;
 | 
				
			||||
 | 
				
			||||
import java.util.Date;
 | 
				
			||||
 | 
				
			||||
@Data
 | 
				
			||||
public class BasicUdiReRequest {
 | 
				
			||||
 | 
				
			||||
 | 
				
			||||
    /**
 | 
				
			||||
     * 国家库uuid
 | 
				
			||||
     */
 | 
				
			||||
    private String uuid;
 | 
				
			||||
 | 
				
			||||
    /**
 | 
				
			||||
     * 企业信息ID外键
 | 
				
			||||
     */
 | 
				
			||||
    private Long companyIdFk;
 | 
				
			||||
 | 
				
			||||
    /**
 | 
				
			||||
     * 更新时间
 | 
				
			||||
     */
 | 
				
			||||
    private Date updateTime;
 | 
				
			||||
 | 
				
			||||
    /**
 | 
				
			||||
     * 备注
 | 
				
			||||
     */
 | 
				
			||||
    private String remark;
 | 
				
			||||
 | 
				
			||||
    /**
 | 
				
			||||
     * 更新人
 | 
				
			||||
     */
 | 
				
			||||
    private String updateUser;
 | 
				
			||||
 | 
				
			||||
}
 | 
				
			||||
@ -0,0 +1,100 @@
 | 
				
			||||
package com.glxp.api.res.basic;
 | 
				
			||||
 | 
				
			||||
import com.baomidou.mybatisplus.annotation.IdType;
 | 
				
			||||
import com.baomidou.mybatisplus.annotation.TableField;
 | 
				
			||||
import com.baomidou.mybatisplus.annotation.TableId;
 | 
				
			||||
import com.fasterxml.jackson.annotation.JsonFormat;
 | 
				
			||||
import lombok.Data;
 | 
				
			||||
 | 
				
			||||
import java.util.Date;
 | 
				
			||||
 | 
				
			||||
@Data
 | 
				
			||||
public class BasicUdiRelResponse {
 | 
				
			||||
 | 
				
			||||
 | 
				
			||||
    private Long id;
 | 
				
			||||
 | 
				
			||||
    /**
 | 
				
			||||
     * 国家库uuid
 | 
				
			||||
     */
 | 
				
			||||
    private String uuid;
 | 
				
			||||
 | 
				
			||||
    /**
 | 
				
			||||
     * 企业信息ID外键
 | 
				
			||||
     */
 | 
				
			||||
    private Long companyIdFk;
 | 
				
			||||
 | 
				
			||||
    /**
 | 
				
			||||
     * 更新时间
 | 
				
			||||
     */
 | 
				
			||||
    private Date updateTime;
 | 
				
			||||
 | 
				
			||||
    /**
 | 
				
			||||
     * 备注
 | 
				
			||||
     */
 | 
				
			||||
    private String remark;
 | 
				
			||||
 | 
				
			||||
    /**
 | 
				
			||||
     * 更新人
 | 
				
			||||
     */
 | 
				
			||||
    private String updateUser;
 | 
				
			||||
 | 
				
			||||
 | 
				
			||||
    private String nameCode;
 | 
				
			||||
    private String packRatio;
 | 
				
			||||
    private String packLevel;
 | 
				
			||||
    private Integer bhxjsl;
 | 
				
			||||
    private Integer bhzxxsbzsl;
 | 
				
			||||
    private Integer zxxsbzbhsydysl;
 | 
				
			||||
    private String bhxjcpbm;
 | 
				
			||||
    private String sjcpbm;  //
 | 
				
			||||
    private String bzcj;
 | 
				
			||||
    private String thirdProductNo;
 | 
				
			||||
    private String thirdProductName;
 | 
				
			||||
    private String addType;
 | 
				
			||||
    private String deviceRecordKey;
 | 
				
			||||
    private Integer isUseDy;
 | 
				
			||||
    private String cpmctymc;
 | 
				
			||||
    private String cplb;
 | 
				
			||||
    private String flbm;
 | 
				
			||||
    private String ggxh;
 | 
				
			||||
    private String qxlb;
 | 
				
			||||
    private String tyshxydm;
 | 
				
			||||
    private String ylqxzcrbarmc;
 | 
				
			||||
    private String zczbhhzbapzbh;
 | 
				
			||||
    private String ylqxzcrbarywmc;
 | 
				
			||||
    private String sydycpbs;
 | 
				
			||||
    private Integer versionNumber;
 | 
				
			||||
    private Integer diType;
 | 
				
			||||
 | 
				
			||||
    private String scbssfbhph;
 | 
				
			||||
    private String scbssfbhxlh;
 | 
				
			||||
    private String scbssfbhscrq;
 | 
				
			||||
    private String scbssfbhsxrq;
 | 
				
			||||
 | 
				
			||||
    private String ybbm;
 | 
				
			||||
    private String spmc;
 | 
				
			||||
    private String cphhhbh;
 | 
				
			||||
    private String cpms;
 | 
				
			||||
    private String cpbsbmtxmc;
 | 
				
			||||
 | 
				
			||||
    private String batchNo;
 | 
				
			||||
    private String produceDate;
 | 
				
			||||
    private String expireDate;
 | 
				
			||||
 | 
				
			||||
    private Boolean isNewest;
 | 
				
			||||
 | 
				
			||||
    private String cplx;
 | 
				
			||||
    private String hchzsb;
 | 
				
			||||
 | 
				
			||||
    private String sfwblztlcp;
 | 
				
			||||
    private String cgzmraqxgxx;
 | 
				
			||||
    private String sfbjwycxsy;
 | 
				
			||||
    private String zdcfsycs;
 | 
				
			||||
    private String sfwwjbz;
 | 
				
			||||
    private String syqsfxyjxmj;
 | 
				
			||||
    private String qtxxdwzlj;
 | 
				
			||||
    private String mjfs;
 | 
				
			||||
 | 
				
			||||
 | 
				
			||||
}
 | 
				
			||||
@ -0,0 +1,9 @@
 | 
				
			||||
package com.glxp.api.service.auth;
 | 
				
			||||
 | 
				
			||||
import com.baomidou.mybatisplus.extension.service.IService;
 | 
				
			||||
import com.glxp.api.entity.auth.UserCompanyEntity;
 | 
				
			||||
 | 
				
			||||
public interface UserCompanyService extends IService<UserCompanyEntity>{
 | 
				
			||||
 | 
				
			||||
 | 
				
			||||
}
 | 
				
			||||
@ -0,0 +1,11 @@
 | 
				
			||||
package com.glxp.api.service.auth.impl;
 | 
				
			||||
 | 
				
			||||
import com.glxp.api.entity.auth.UserCompanyEntity;
 | 
				
			||||
import org.springframework.stereotype.Service;
 | 
				
			||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
				
			||||
import com.glxp.api.dao.auth.UserCompanyMapper;
 | 
				
			||||
import com.glxp.api.service.auth.UserCompanyService;
 | 
				
			||||
@Service
 | 
				
			||||
public class UserCompanyServiceImpl extends ServiceImpl<UserCompanyMapper, UserCompanyEntity> implements UserCompanyService{
 | 
				
			||||
 | 
				
			||||
}
 | 
				
			||||
@ -0,0 +1,27 @@
 | 
				
			||||
package com.glxp.api.service.basic;
 | 
				
			||||
 | 
				
			||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
 | 
				
			||||
import com.glxp.api.req.basic.FilterUdiRelRequest;
 | 
				
			||||
import com.glxp.api.res.basic.BasicUdiRelResponse;
 | 
				
			||||
import org.springframework.stereotype.Service;
 | 
				
			||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 | 
				
			||||
import com.glxp.api.dao.basic.BasicUdiRelMapper;
 | 
				
			||||
import com.glxp.api.entity.basic.BasicUdiRelEntity;
 | 
				
			||||
 | 
				
			||||
import javax.annotation.Resource;
 | 
				
			||||
import java.util.List;
 | 
				
			||||
 | 
				
			||||
@Service
 | 
				
			||||
public class BasicUdiRelService extends ServiceImpl<BasicUdiRelMapper, BasicUdiRelEntity> {
 | 
				
			||||
 | 
				
			||||
    @Resource
 | 
				
			||||
    BasicUdiRelMapper basicUdiRelMapper;
 | 
				
			||||
 | 
				
			||||
    public boolean isExit(String uuid, Long companyId) {
 | 
				
			||||
        return basicUdiRelMapper.exists(new QueryWrapper<BasicUdiRelEntity>().eq("uuid", uuid).eq("companyIdFk", companyId));
 | 
				
			||||
    }
 | 
				
			||||
 | 
				
			||||
    public List<BasicUdiRelResponse> filterList(FilterUdiRelRequest filterUdiRelRequest) {
 | 
				
			||||
        return basicUdiRelMapper.filterList(filterUdiRelRequest);
 | 
				
			||||
    }
 | 
				
			||||
}
 | 
				
			||||
@ -0,0 +1,4 @@
 | 
				
			||||
<?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.glxp.api.dao.auth.UserCompanyMapper">
 | 
				
			||||
</mapper>
 | 
				
			||||
@ -0,0 +1,18 @@
 | 
				
			||||
<?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.glxp.api.dao.basic.BasicUdiRelEntityMapper">
 | 
				
			||||
  <resultMap id="BaseResultMap" type="com.glxp.api.entity.basic.BasicUdiRelEntity">
 | 
				
			||||
    <!--@mbg.generated-->
 | 
				
			||||
    <!--@Table basic_udi_rel-->
 | 
				
			||||
    <id column="id" jdbcType="BIGINT" property="id" />
 | 
				
			||||
    <result column="uuid" jdbcType="VARCHAR" property="uuid" />
 | 
				
			||||
    <result column="companyIdFk" jdbcType="BIGINT" property="companyIdFk" />
 | 
				
			||||
    <result column="updateTime" jdbcType="TIMESTAMP" property="updateTime" />
 | 
				
			||||
    <result column="remark" jdbcType="VARCHAR" property="remark" />
 | 
				
			||||
    <result column="updateUser" jdbcType="VARCHAR" property="updateUser" />
 | 
				
			||||
  </resultMap>
 | 
				
			||||
  <sql id="Base_Column_List">
 | 
				
			||||
    <!--@mbg.generated-->
 | 
				
			||||
    id, uuid, companyIdFk, updateTime, remark, updateUser
 | 
				
			||||
  </sql>
 | 
				
			||||
</mapper>
 | 
				
			||||
@ -0,0 +1,49 @@
 | 
				
			||||
<?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.glxp.api.dao.basic.BasicUdiRelMapper">
 | 
				
			||||
    <select id="filterList" parameterType="com.glxp.api.req.basic.FilterUdiRelRequest"
 | 
				
			||||
            resultType="com.glxp.api.res.basic.BasicUdiRelResponse">
 | 
				
			||||
        select *
 | 
				
			||||
        FROM basic_udi_rel
 | 
				
			||||
                     inner JOIN productinfo p on basic_udi_rel.uuid = p.uuid
 | 
				
			||||
        <where>
 | 
				
			||||
            <if test="ylqxzcrbarmc != '' and ylqxzcrbarmc != null">
 | 
				
			||||
                AND ylqxzcrbarmc LIKE concat('%', #{ylqxzcrbarmc}, '%')
 | 
				
			||||
            </if>
 | 
				
			||||
            <if test="cpmctymc != '' and cpmctymc != null">
 | 
				
			||||
                AND cpmctymc LIKE concat('%', #{cpmctymc}, '%')
 | 
				
			||||
            </if>
 | 
				
			||||
            <if test="nameCode != '' and nameCode != null">
 | 
				
			||||
                AND nameCode LIKE concat(#{nameCode}, '%')
 | 
				
			||||
            </if>
 | 
				
			||||
            <if test="uuid != '' and uuid != null">
 | 
				
			||||
                AND basic_udi_rel.uuid = #{uuid}
 | 
				
			||||
            </if>
 | 
				
			||||
            <if test="id != '' and id != null">
 | 
				
			||||
                AND basic_udi_rel.id = #{id}
 | 
				
			||||
            </if>
 | 
				
			||||
            <if test="diType != null">
 | 
				
			||||
                AND diType = #{diType}
 | 
				
			||||
            </if>
 | 
				
			||||
            <if test="zczbhhzbapzbh != '' and zczbhhzbapzbh != null">
 | 
				
			||||
                AND zczbhhzbapzbh LIKE concat(#{zczbhhzbapzbh}, '%')
 | 
				
			||||
            </if>
 | 
				
			||||
            <if test="lastUpdateTime != null and lastUpdateTime != ''">
 | 
				
			||||
                <![CDATA[
 | 
				
			||||
                and DATE_FORMAT(basic_udi_rel.updateTime, '%Y-%m-%d %H:%i:%S') >=
 | 
				
			||||
                    DATE_FORMAT(#{lastUpdateTime}, '%Y-%m-%d %H:%i:%S')
 | 
				
			||||
                ]]>
 | 
				
			||||
            </if>
 | 
				
			||||
            <if test="unionFilterStr != '' and unionFilterStr != null">
 | 
				
			||||
                or p.cpmctymc LIKE concat('%', #{unionFilterStr}, '%')
 | 
				
			||||
                or p.ylqxzcrbarmc LIKE concat('%', #{unionFilterStr}, '%')
 | 
				
			||||
                or p.ggxh LIKE concat('%', #{unionFilterStr}, '%')
 | 
				
			||||
                or p.zczbhhzbapzbh LIKE concat('%', #{unionFilterStr}, '%')
 | 
				
			||||
            </if>
 | 
				
			||||
            <if test="uniqueNameCode != '' and uniqueNameCode != null">
 | 
				
			||||
                AND nameCode = #{uniqueNameCode}
 | 
				
			||||
            </if>
 | 
				
			||||
        </where>
 | 
				
			||||
        ORDER BY basic_udi_rel.updateTime DESC
 | 
				
			||||
    </select>
 | 
				
			||||
</mapper>
 | 
				
			||||
					Loading…
					
					
				
		Reference in New Issue