新增基础信息维护,企业信息相关

ww
anthonywj 2 years ago
parent f8ca58b378
commit 083d78d348

@ -23,7 +23,6 @@ import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.entity.auth.UserPersonEntity;
import com.glxp.api.entity.auth.UserRegisterEntity;
import com.glxp.api.req.auth.UserResisterFilterRequest;
import com.glxp.api.service.auth.UserPersonService;
import com.glxp.api.service.auth.UserRegisterService;
import com.glxp.api.util.CaptchaUtils;
@ -40,19 +39,19 @@ public class RegisterController {
private UserRegisterService userRegisterService;
@Resource
private UserPersonService userPersonService;
@PostMapping("/admin/auth/register/getCheckcode")
public BaseResponse getCheckcode(@RequestBody Map<String,Object> params, HttpSession httpSession) {
logger.info("---------------"+JSON.toJSONString(params));
return CaptchaUtils.getCheckcode(params,httpSession);
}
@PostMapping("/admin/auth/register/checkCode")
public BaseResponse checkCode(@RequestBody Map<String,Object> params) {
logger.info("---------------"+JSON.toJSONString(params));
return CaptchaUtils.checkCode(params);
}
/**
*
*
@ -70,14 +69,14 @@ public class RegisterController {
}
return ResultVOUtils.success(userRegisterEntity);
}
@PostMapping("/admin/auth/register/save")
public BaseResponse saveRegister(@RequestBody @Valid UserRegisterEntity userRegisterEntity, HttpSession httpSession,
BindingResult bindingResult) {
if (bindingResult.hasErrors()) {
return ResultVOUtils.error(ResultEnum.PARAM_VERIFY_FALL, bindingResult.getFieldError().getDefaultMessage());
}
//校验邮箱是否正确
if (StrUtil.isNotBlank(userRegisterEntity.getEmail())) {
boolean match = ReUtil.isMatch("^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$", userRegisterEntity.getEmail());
@ -87,7 +86,7 @@ public class RegisterController {
}
UserRegisterEntity userRegisterEntity2 = userRegisterService.selectByCompanyName(userRegisterEntity.getCompanyName());
if (userRegisterEntity2 !=null ) {
if(StringUtils.isEmpty(userRegisterEntity.getId()))
if(StringUtils.isEmpty(userRegisterEntity.getId()))
return ResultVOUtils.error(500, "该单位已被注册!");
if(!userRegisterEntity2.getId().equals(userRegisterEntity.getId()))
return ResultVOUtils.error(500, "该单位已被注册!");
@ -100,14 +99,14 @@ public class RegisterController {
} else {
b = userRegisterService.insertUserRegister(userRegisterEntity);
}
if (!b) {
return ResultVOUtils.error(ResultEnum.NOT_NETWORK);
}
return ResultVOUtils.success();
}
@GetMapping("/admin/auth/register/list")
public BaseResponse list(UserResisterFilterRequest userResisterFilterRequest, BindingResult bindingResult) {
if (bindingResult.hasErrors()) {

@ -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);
}
}

@ -1,11 +1,24 @@
package com.glxp.api.controller.basic;
import java.util.Date;
import java.util.List;
import javax.annotation.Resource;
import cn.hutool.core.util.IdUtil;
import com.glxp.api.entity.auth.DeptUserEntity;
import com.glxp.api.entity.basic.*;
import com.glxp.api.req.auth.FilterDeptUserReqeust;
import com.glxp.api.req.basic.BasicUdiReRequest;
import com.glxp.api.res.auth.AuthAdminResponse;
import com.glxp.api.res.basic.BasicUdiRelResponse;
import com.glxp.api.service.auth.CustomerService;
import com.glxp.api.service.basic.BasicUdiRelService;
import lombok.Data;
import org.springframework.beans.BeanUtils;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;
import com.github.pagehelper.PageInfo;
@ -13,11 +26,6 @@ import com.glxp.api.annotation.AuthRuleAnnotation;
import com.glxp.api.common.res.BaseResponse;
import com.glxp.api.common.util.ResultVOUtils;
import com.glxp.api.constant.AsyncDiDlHelper;
import com.glxp.api.entity.basic.ProductInfoEntity;
import com.glxp.api.entity.basic.UdiCompanyEntity;
import com.glxp.api.entity.basic.UdiEntity;
import com.glxp.api.entity.basic.UdiProductEntity;
import com.glxp.api.entity.basic.UdiRelevanceEntity;
import com.glxp.api.req.basic.FilterUdiRelRequest;
import com.glxp.api.req.basic.ProductInfoFilterRequest;
import com.glxp.api.req.basic.UdiCompanyRequest;
@ -40,11 +48,13 @@ public class UdiSyncController {
@Resource
SyncUdiService syncUdiService;
@Resource
AsyncDiDlHelper asyncDiDlHelper;
@Resource
ProductInfoService productInfoService;
@Resource
UdiCompanyService udiCompanyService;
@Resource
BasicUdiRelService basicUdiRelService;
@Resource
CustomerService customerService;
//获取同步库UDI信息
@ -76,22 +86,11 @@ public class UdiSyncController {
List<ProductInfoEntity> productInfoEntities = udiDlDeviceResponse.getData().getList();
if (productInfoEntities != null && productInfoEntities.size() > 0) {
for (ProductInfoEntity productInfoEntity : productInfoEntities) {
// List<UdiRelevanceEntity> udiRelevanceEntities = udiRelevanceService.selectByUuid(productInfoEntity.getUuid());
// if (udiRelevanceEntities != null && udiRelevanceEntities.size() > 0) {
// for (UdiRelevanceEntity udiRelevanceEntity : udiRelevanceEntities) {
// if (udiRelevanceEntity.getThirdId() == null &&
// udiRelevanceEntity.getThirdId2() == null && udiRelevanceEntity.getThirdId1() == null &&
// udiRelevanceEntity.getThirdId3() == null && udiRelevanceEntity.getThirdId4() == null) {
// //不能添加
// productInfoEntity.setCheck(true);
// break;
// } else
// productInfoEntity.setCheck(false);
// }
//
// } else {
// productInfoEntity.setCheck(false);
// }
Boolean isExit = basicUdiRelService.isExit(productInfoEntity.getUuid(), filterUdiRelRequest.getCompanyId());
if (isExit) {
productInfoEntity.setCheck(true);
} else
productInfoEntity.setCheck(false);
}
}
}
@ -119,6 +118,56 @@ public class UdiSyncController {
}
//获取同步库UDI信息
@AuthRuleAnnotation("")
@GetMapping("udi/basic/rel/filter")
public BaseResponse filterRel(FilterUdiRelRequest filterUdiRelRequest) {
String nameCode;
if (StrUtil.isNotEmpty(filterUdiRelRequest.getUdiCode())) {
UdiEntity udiEntity = FilterUdiUtils.getUdi(filterUdiRelRequest.getUdiCode());
if (udiEntity != null) {
nameCode = udiEntity.getUdi();
} else {
return ResultVOUtils.error(500, "无效UDI码");
}
} else
nameCode = filterUdiRelRequest.getNameCode();
if (StrUtil.isNotEmpty(nameCode)) {
filterUdiRelRequest.setNameCode(nameCode);
} else {
filterUdiRelRequest.setDiType(1);
}
List<BasicUdiRelResponse> udiDlDeviceResponse = basicUdiRelService.filterList(filterUdiRelRequest);
PageInfo<BasicUdiRelResponse> basicUdiRelResponsePageInfo = new PageInfo<>(udiDlDeviceResponse);
PageSimpleResponse<BasicUdiRelResponse> basicUdiRelResponsePageSimpleResponse = new PageSimpleResponse<>();
basicUdiRelResponsePageSimpleResponse.setTotal(basicUdiRelResponsePageInfo.getTotal());
basicUdiRelResponsePageSimpleResponse.setList(udiDlDeviceResponse);
return ResultVOUtils.success(basicUdiRelResponsePageSimpleResponse);
}
//产品信息关联新增
@AuthRuleAnnotation("")
@PostMapping("udi/basic/rel/save")
public BaseResponse saveRel(@RequestBody BasicUdiReRequest basicUdiReRequest) {
BasicUdiRelEntity basicUdiRelEntity = new BasicUdiRelEntity();
BeanUtils.copyProperties(basicUdiReRequest, basicUdiRelEntity);
basicUdiRelEntity.setUpdateTime(new Date());
basicUdiRelEntity.setUpdateUser(customerService.getUserId() + "");
basicUdiRelEntity.setId(IdUtil.getSnowflakeNextId());
basicUdiRelService.save(basicUdiRelEntity);
return ResultVOUtils.success("添加成功!");
}
//产品信息关联修改
@AuthRuleAnnotation("")
@PostMapping("udi/basic/rel/update")
public BaseResponse updateRel(@RequestBody BasicUdiRelEntity basicUdiRelEntity) {
basicUdiRelEntity.setUpdateTime(new Date());
basicUdiRelEntity.setUpdateUser(customerService.getUserId() + "");
basicUdiRelService.updateById(basicUdiRelEntity);
return ResultVOUtils.success("添加成功!");
}
//出入库同步下载
@GetMapping("udidl/udiwms/syncUdi")

@ -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,86 @@
package com.glxp.api.entity.auth;
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 = "user_company")
public class UserCompanyEntity implements Serializable {
@TableId(value = "id", type = IdType.INPUT)
private Long id;
/**
*
*/
@TableField(value = "companyName")
private String companyName;
/**
*
*/
@TableField(value = "creditNum")
private String creditNum;
/**
* 1,2,3,.4.
*/
@TableField(value = "bussinessStatus")
private String bussinessStatus;
/**
*
*/
@TableField(value = "registerTime")
private Date registerTime;
/**
*
*/
@TableField(value = "legalPerson")
private String legalPerson;
/**
*
*/
@TableField(value = "legalIdCard")
private String legalIdCard;
/**
*
*/
@TableField(value = "registerAddress")
private String registerAddress;
/**
*
*/
@TableField(value = "contactWay")
private String contactWay;
/**
*
*/
@TableField(value = "comments")
private String comments;
/**
* 0 /3 /1 /2
*/
@TableField(value = "checkStatus")
private String checkStatus;
/**
* 1 0
*/
@TableField(value = "`status`")
private String status;
private static final long serialVersionUID = 1L;
}

@ -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;
}

@ -70,4 +70,6 @@ public class FilterUdiRelRequest extends ListPageRequest {
private Boolean dispatch;
private Boolean groupBuy;
private Long companyId;
}

@ -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);
}
}

@ -1,12 +1,12 @@
server:
port: 9991
port: 9998
spring:
datasource:
driver-class-name: com.p6spy.engine.spy.P6SpyDriver
jdbc-url: jdbc:p6spy:mysql://127.0.0.1:3306/udi_cpt?allowMultiQueries=true&serverTimezone=Asia/Shanghai&useUnicode=true&characterEncoding=utf8&zeroDateTimeBehavior=convertToNull&useSSL=false&allowPublicKeyRetrieval=true
username: root
password: Glxp@6066
password: 123456
hikari:
connection-timeout: 60000
maximum-pool-size: 20

@ -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…
Cancel
Save