Browse Source

送码入企功能

v5
庄锐波 7 months ago
parent
commit
9c2b6a98cf
  1. 7
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnterprisePubQrcodeController.java
  2. 10
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/EnterprisePubQrcodeMapper.java
  3. 6
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterprisePubQrcodeServiceImpl.java
  4. 8
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnterprisePubQrcodeMapper.xml

7
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnterprisePubQrcodeController.java

@ -3,6 +3,8 @@ package com.zdxt.code.controller;
import java.io.IOException;
import java.util.List;
import com.zdxt.auth.dto.UserBean;
import com.zdxt.auth.feign.UserApi;
import com.zdxt.common.ZDResponse;
import com.zdxt.common.controller.BaseController;
import com.zdxt.common.util.TableDataInfo;
@ -34,6 +36,9 @@ import javax.servlet.http.HttpServletResponse;
@RequestMapping("/code/enterprisePubQrcode")
public class EnterprisePubQrcodeController extends BaseController
{
@Autowired
private UserApi userApi;
private static final Logger log = LoggerFactory.getLogger(EnterprisePubQrcodeController.class);
private String prefix = "project/code/enterprise_pub_qrcode";
@ -57,6 +62,8 @@ public class EnterprisePubQrcodeController extends BaseController
public TableDataInfo list(EnterprisePubQrcode enterprisePubQrcode)
{
startPage();
UserBean currentUser = userApi.getCurrentUser();
enterprisePubQrcode.setUserId(currentUser.getUserId());
List<EnterprisePubQrcode> list = enterprisePubQrcodeService.selectEnterprisePubQrcodeList(enterprisePubQrcode);
return getDataTable(list);
}

10
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/EnterprisePubQrcodeMapper.java

@ -68,6 +68,16 @@ public interface EnterprisePubQrcodeMapper
*/
EnterprisePubQrcode selectEnterprisePubQrcodeByEnterpriseNumber(String enterpriseNumber);
/**
* 根据统一社会信用代码和用户ID查询送码入企信息
*
* @param enterpriseNumber 统一社会信用代码
* @param userId 用户ID
* @return 送码入企信息
*/
EnterprisePubQrcode selectByEnterpriseNumberAndUserId(@org.apache.ibatis.annotations.Param("enterpriseNumber") String enterpriseNumber,
@org.apache.ibatis.annotations.Param("userId") Long userId);
/**
* 根据ID数组批量查询送码入企信息
*

6
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterprisePubQrcodeServiceImpl.java

@ -290,12 +290,12 @@ public class EnterprisePubQrcodeServiceImpl implements IEnterprisePubQrcodeServi
throw new Exception("导入失败:" + errorMsg.toString());
}
// 4.批量导入数据(根据EnterpriseNumber判断新增或更新)
// 4.批量导入数据(根据EnterpriseNumber和UserId判断新增或更新)
int insertCount = 0;
int updateCount = 0;
for (EnterprisePubQrcode item : dataList)
{
EnterprisePubQrcode existing = enterprisePubQrcodeMapper.selectEnterprisePubQrcodeByEnterpriseNumber(item.getEnterpriseNumber().trim());
EnterprisePubQrcode existing = enterprisePubQrcodeMapper.selectByEnterpriseNumberAndUserId(item.getEnterpriseNumber().trim(), currentUser.getUserId());
if (existing != null)
{
// 已存在,更新记录并重置状态
@ -891,6 +891,8 @@ public class EnterprisePubQrcodeServiceImpl implements IEnterprisePubQrcodeServi
*/
private void generateAndStoreBlueQrCode(EnterprisePubQrcode record, EnterpriseInformation enterpriseInfo) throws Exception
{
UserBean currentUser = userApi.getCurrentUser();
String enterpriseNumber = record.getEnterpriseNumber();
// 检查qr_code_generate_history表中是否已存在该企业由送码入企生成的有效二维码记录

8
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnterprisePubQrcodeMapper.xml

@ -53,6 +53,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="downloadStatus != null and downloadStatus != ''"> and download_status = #{downloadStatus}</if>
<if test="deptName != null and deptName != ''"> and dept_name like concat('%', #{deptName}, '%')</if>
<if test="deptId != null and deptId != ''"> and dept_id = #{deptId}</if>
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
<if test="userName != null and userName != ''"> and user_name like concat('%', #{userName}, '%')</if>
<if test="importFileName != null and importFileName != ''"> and import_file_name like concat('%', #{importFileName}, '%')</if>
<if test="remark != null and remark != ''"> and remark like concat('%', #{remark}, '%')</if>
@ -71,6 +72,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
limit 1
</select>
<select id="selectByEnterpriseNumberAndUserId" resultMap="EnterprisePubQrcodeResult">
<include refid="selectEnterprisePubQrcodeVo"/>
where enterprise_number = #{enterpriseNumber}
and user_id = #{userId}
limit 1
</select>
<select id="selectEnterprisePubQrcodeByIds" resultMap="EnterprisePubQrcodeResult">
<include refid="selectEnterprisePubQrcodeVo"/>
where id in

Loading…
Cancel
Save