Browse Source

统计分析接口

v2
chenrui 2 years ago
parent
commit
ebd33249eb
  1. 19
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnterpriseInformationController.java
  2. 12
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnforcementInspectionProgram.java
  3. 13
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnterpriseInformation.java
  4. 13
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/QrCodeGenerateHistory.java
  5. 49
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/StatisticalVo.java
  6. 14
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/EnterpriseInformationMapper.java
  7. 7
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/StatisticalMapper.java
  8. 21
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java
  9. 7
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementInspectionProgramMapper.xml
  10. 28
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnterpriseInformationMapper.xml
  11. 3
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/QrCodeGenerateHistoryMapper.xml
  12. 57
      lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalMapper.xml

19
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/controller/EnterpriseInformationController.java

@ -54,6 +54,17 @@ public class EnterpriseInformationController extends BaseController
List<EnterpriseInformation> list = enterpriseInformationService.selectEnterpriseInformationList(enterpriseInformation);
return getDataTable(list);
}
/**
* 查询企业信息登记列表
*/
@GetMapping("/queryList")
@ResponseBody
public ZDResponse queryList(EnterpriseInformation enterpriseInformation)
{
startPage();
List<EnterpriseInformation> list = enterpriseInformationService.selectEnterpriseInformationList(enterpriseInformation);
return ZDResponse.success("查询成功",list);
}
/**
* 新增企业信息登记
@ -182,4 +193,12 @@ public class EnterpriseInformationController extends BaseController
}*/
return ZDResponse.success("查询成功",enterpriseInformation);
}
@ResponseBody
@GetMapping("/queryHistoryQrCodeList")
public ZDResponse queryHistoryQrCodeList(QrCodeGenerateHistory qrCodeGenerateHistory){
List<QrCodeGenerateHistory> qrCodeGenerateHistories =
iQrCodeGenerateHistoryService.selectQrCodeGenerateHistoryList(qrCodeGenerateHistory);
return ZDResponse.success("查询二维码历史记录成功",qrCodeGenerateHistories);
}
}

12
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnforcementInspectionProgram.java

@ -39,6 +39,10 @@ public class EnforcementInspectionProgram extends BaseDomain
/** 是否删除 0 否 1是 */
private Integer isDelete;
/**
* 是否发布 0 1
*/
private Integer isPublish;
/**
* 上传文件列表
@ -192,6 +196,14 @@ public class EnforcementInspectionProgram extends BaseDomain
this.dateSearch = dateSearch;
}
public Integer getIsPublish() {
return isPublish;
}
public void setIsPublish(Integer isPublish) {
this.isPublish = isPublish;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

13
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/EnterpriseInformation.java

@ -72,6 +72,11 @@ public class EnterpriseInformation extends BaseDomain
*/
private Integer isDelete;
/**
* 企业联系人电话
*/
private String enterpriseTel;
public void setId(String id)
{
this.id = id;
@ -206,6 +211,14 @@ public class EnterpriseInformation extends BaseDomain
this.salt = salt;
}
public String getEnterpriseTel() {
return enterpriseTel;
}
public void setEnterpriseTel(String enterpriseTel) {
this.enterpriseTel = enterpriseTel;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

13
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/QrCodeGenerateHistory.java

@ -38,6 +38,11 @@ public class QrCodeGenerateHistory extends BaseDomain
*/
private Integer status;
/**
* 二维码变更原因
*/
private String reasonsChange;
public void setId(String id)
{
this.id = id;
@ -94,6 +99,14 @@ public class QrCodeGenerateHistory extends BaseDomain
this.enterpriseName = enterpriseName;
}
public String getReasonsChange() {
return reasonsChange;
}
public void setReasonsChange(String reasonsChange) {
this.reasonsChange = reasonsChange;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)

49
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/domain/StatisticalVo.java

@ -15,6 +15,23 @@ public class StatisticalVo extends BaseDomain {
*/
private Integer total;
/**
* 执法事项
*/
private String lawEnforcementItem;
/**
* 执法事项ID
*/
private String lawEnforcementItemId;
/**
* 字典名称
*/
private String dictLabel;
/**
* 企业类型
*/
private Integer enterpriseType;
public String getLawEnforcement() {
return lawEnforcement;
@ -31,4 +48,36 @@ public class StatisticalVo extends BaseDomain {
public void setTotal(Integer total) {
this.total = total;
}
public String getLawEnforcementItem() {
return lawEnforcementItem;
}
public void setLawEnforcementItem(String lawEnforcementItem) {
this.lawEnforcementItem = lawEnforcementItem;
}
public String getLawEnforcementItemId() {
return lawEnforcementItemId;
}
public void setLawEnforcementItemId(String lawEnforcementItemId) {
this.lawEnforcementItemId = lawEnforcementItemId;
}
public String getDictLabel() {
return dictLabel;
}
public void setDictLabel(String dictLabel) {
this.dictLabel = dictLabel;
}
public Integer getEnterpriseType() {
return enterpriseType;
}
public void setEnterpriseType(Integer enterpriseType) {
this.enterpriseType = enterpriseType;
}
}

14
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/EnterpriseInformationMapper.java

@ -50,6 +50,13 @@ public interface EnterpriseInformationMapper
*/
public int updateEnterpriseInformation(EnterpriseInformation enterpriseInformation);
/**
* 修改企业登记信息
* @param enterpriseInformation
* @return
*/
public int updateEnterpriseInformationByEnterpriseNumber(EnterpriseInformation enterpriseInformation);
/**
* 删除企业信息登记
*
@ -65,4 +72,11 @@ public interface EnterpriseInformationMapper
* @return 结果
*/
public int deleteEnterpriseInformationByIds(String[] ids);
/**
* 通过查询企业信息
* @param enterpriseName
* @return
*/
public List<EnterpriseInformation> selectEnterpriseInformationByName(String enterpriseName);
}

7
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/mapper/StatisticalMapper.java

@ -13,4 +13,11 @@ public interface StatisticalMapper {
* @return
*/
List<StatisticalVo> StatisticalCaseload(StatisticalVo statisticalVo);
/**
* 统计执法部门
* @param statisticalVo
* @return
*/
List<StatisticalVo> statisticalLawEnforcementItem(StatisticalVo statisticalVo);
}

21
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/java/com/zdxt/code/service/impl/EnterpriseInformationServiceImpl.java

@ -54,6 +54,9 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS
@Value("${ruoyi.profile}")
private String filePath;
@Value("${qr_code_url}")
private String qrCodeUrl;
@Autowired
private FileUploadApi fileUploadApi;
@ -106,15 +109,15 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS
public int insertEnterpriseInformation(EnterpriseInformation enterpriseInformation)
{
enterpriseInformation.setCreateTime(DateUtils.getNowDate());
enterpriseInformation.setId(IdUtil.simpleUUID());
UserBean user = userApi.getCurrentUser();
enterpriseInformation.setCreateBy(user.getUserName());
enterpriseInformation.setUserId(user.getUserId());
enterpriseInformation.setDeptId(user.getDeptId());
// enterpriseInformation.setId(IdUtil.simpleUUID());
// UserBean user = userApi.getCurrentUser();
// enterpriseInformation.setCreateBy(user.getUserName());
// enterpriseInformation.setUserId(user.getUserId());
// enterpriseInformation.setDeptId(user.getDeptId());
//生成企业统一信用代码盐
String salt = PasswordTools.encrypt(enterpriseInformation.getEnterpriseNumber());
enterpriseInformation.setSalt(salt);
int i = enterpriseInformationMapper.insertEnterpriseInformation(enterpriseInformation);
int i = enterpriseInformationMapper.updateEnterpriseInformationByEnterpriseNumber(enterpriseInformation);
if(i > 0){
String text = salt;
//这里设置自定义网站url
@ -144,8 +147,8 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS
enterpriseMerchantAuthorization.setEnterpriseName(enterpriseInformation.getEnterpriseName());
enterpriseMerchantAuthorization.setId(IdUtil.simpleUUID());
enterpriseMerchantAuthorization.setEnterpriseNumber(enterpriseInformation.getEnterpriseNumber());
enterpriseMerchantAuthorization.setMerchantName(user.getUserName());
enterpriseMerchantAuthorization.setMerchantTel(user.getPhonenumber());
enterpriseMerchantAuthorization.setMerchantName(enterpriseInformation.getLegalPerson());
enterpriseMerchantAuthorization.setMerchantTel(enterpriseInformation.getEnterpriseTel());
iEnterpriseMerchantAuthorizationService.insertEnterpriseMerchantAuthorization(enterpriseMerchantAuthorization);
}
@ -209,7 +212,7 @@ public class EnterpriseInformationServiceImpl implements IEnterpriseInformationS
// TODO 企业添加成功,生成企业二维码
String text = "https://www.baidu.com/s?ie=UTF-8&wd=%E7%99%BE%E5%BA%A6";
//这里设置自定义网站url
String logoPath =null;
String logoPath = qrCodeUrl;
String upload = null;
try {
File encode = QRCodeUtil.encodeFile(text, logoPath, filePath, true);

7
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnforcementInspectionProgramMapper.xml

@ -17,10 +17,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="userId" column="user_id" />
<result property="deptId" column="dept_id" />
<result property="isDelete" column="is_delete" />
<result property="isPublish" column="is_publish" />
</resultMap>
<sql id="selectEnforcementInspectionProgramVo">
select id, plan_year, plan_name, enforcement_department, enforcement_department_id, enforcement_time, enforcement_area, create_time, create_by, user_id, dept_id, is_delete from enforcement_inspection_program
select id, plan_year, plan_name, enforcement_department, enforcement_department_id, enforcement_time, enforcement_area, create_time, create_by, user_id, dept_id, is_delete,is_publish from enforcement_inspection_program
</sql>
<select id="selectEnforcementInspectionProgramList" parameterType="EnforcementInspectionProgram" resultMap="EnforcementInspectionProgramResult">
@ -35,6 +36,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userId != null and userId != ''"> and user_id = #{userId}</if>
<if test="deptId != null and deptId != ''"> and dept_id = #{deptId}</if>
<if test="isDelete != null "> and is_delete = #{isDelete}</if>
<if test="isPublish != null "> and is_publish = #{isPublish}</if>
<if test="searchText != null and searchText != ''">
and (plan_name like concat('%', #{searchText}, '%')
or enforcement_department like concat('%', #{searchText}, '%')
@ -66,6 +68,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userId != null and userId != ''">user_id,</if>
<if test="deptId != null and deptId != ''">dept_id,</if>
<if test="isDelete != null ">is_delete,</if>
<if test="isPublish != null ">is_publish,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="id != null and id != ''">#{id},</if>
@ -80,6 +83,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userId != null and userId != ''">#{userId},</if>
<if test="deptId != null and deptId != ''">#{deptId},</if>
<if test="isDelete != null ">#{isDelete},</if>
<if test="isPublish != null ">#{is_publish},</if>
</trim>
</insert>
@ -97,6 +101,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if test="userId != null and userId != ''">user_id = #{userId},</if>
<if test="deptId != null and deptId != ''">dept_id = #{deptId},</if>
<if test="isDelete != null ">is_delete = #{isDelete},</if>
<if test="isPublish != null ">is_publish = #{isPublish},</if>
</trim>
where id = #{id}
</update>

28
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/EnterpriseInformationMapper.xml

@ -22,11 +22,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="isUnsubscribe" column="is_unsubscribe" />
<result property="isDelete" column="is_delete" />
<result property="salt" column="salt" />
<result property="enterpriseTel" column="enterprise_tel" />
</resultMap>
<sql id="selectEnterpriseInformationVo">
select id, enterprise_name, enterprise_number, enterprise_type, enterprise_address, legal_person, registered_capital, establishment_time,
operating_term, business_scope, create_time, create_by, user_id, dept_id,is_unsubscribe ,is_delete,salt from enterprise_information
operating_term, business_scope, create_time, create_by, user_id, dept_id,is_unsubscribe ,is_delete,salt,enterprise_tel from enterprise_information
</sql>
<select id="selectEnterpriseInformationList" parameterType="EnterpriseInformation" resultMap="EnterpriseInformationResult">
@ -105,6 +106,24 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<!-- <if test="enterpriseNumber != null and enterpriseNumber != ''">enterprise_number = #{enterpriseNumber},</if>-->
<update id="updateEnterpriseInformation" parameterType="EnterpriseInformation">
update enterprise_information
<trim prefix="SET" suffixOverrides=",">
<if test="enterpriseName != null and enterpriseName != ''">enterprise_name = #{enterpriseName},</if>
<if test="enterpriseType != null and enterpriseType != ''">enterprise_type = #{enterpriseType},</if>
<if test="enterpriseAddress != null and enterpriseAddress != ''">enterprise_address = #{enterpriseAddress},</if>
<if test="legalPerson != null and legalPerson != ''">legal_person = #{legalPerson},</if>
<if test="registeredCapital != null and registeredCapital != ''">registered_capital = #{registeredCapital},</if>
<if test="establishmentTime != null ">establishment_time = #{establishmentTime},</if>
<if test="operatingTerm != null ">operating_term = #{operatingTerm},</if>
<if test="businessScope != null and businessScope != ''">business_scope = #{businessScope},</if>
<if test="createTime != null ">create_time = #{createTime},</if>
<if test="createBy != null and createBy != ''">create_by = #{createBy},</if>
<if test="isUnsubscribe != null">is_unsubscribe = #{isUnsubscribe},</if>
<if test="salt != null and salt != ''">salt = #{isUnsubscribe}</if>
</trim>
where enterprise_number = #{enterpriseNumber}
</update>
<update id="updateEnterpriseInformationByEnterpriseNumber" parameterType="EnterpriseInformation">
update enterprise_information
<trim prefix="SET" suffixOverrides=",">
<if test="enterpriseName != null and enterpriseName != ''">enterprise_name = #{enterpriseName},</if>
@ -132,5 +151,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{id}
</foreach>
</delete>
<select id="selectEnterpriseInformationByName" parameterType="EnterpriseInformation" resultMap="EnterpriseInformationResult">
<include refid="selectEnterpriseInformationVo"/>
where enterprise_name like concat('%', #{enterpriseName}, '%')
and is_delete =
order by create_time desc
</select>
</mapper>

3
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/QrCodeGenerateHistoryMapper.xml

@ -10,10 +10,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result property="qrCodeUrl" column="qr_code_url" />
<result property="enterpriseNumber" column="enterprise_number" />
<result property="status" column="status" />
<result property="reasonsChange" column="reasons_change" />
</resultMap>
<sql id="selectQrCodeGenerateHistoryVo">
select id, generate_time, qr_code_url,enterprise_number,status from qr_code_generate_history
select id, generate_time, qr_code_url,enterprise_number,status,reasons_change from qr_code_generate_history
</sql>
<select id="selectQrCodeGenerateHistoryList" parameterType="QrCodeGenerateHistory" resultMap="QrCodeGenerateHistoryResult">

57
lib/EmergencyService/zdxtLawEnforcementCodeService/src/main/resources/mapper/StatisticalMapper.xml

@ -10,6 +10,9 @@
<result property="deptId" column="dept_id" />
<result property="lawEnforcement" column="law_enforcement" />
<result property="total" column="total" />
<result property="lawEnforcementItem" column="law_enforcement_item" />
<result property="dictLabel" column="dict_label" />
<result property="enterpriseType" column="enterprise_type" />
</resultMap>
@ -27,4 +30,58 @@
GROUP BY law_enforcement_id
</select>
<select id="statisticalLawEnforcementItem" parameterType="StatisticalVo" resultMap="StatisticalVoResult">
select law_enforcement_item,count(*) as total from enforcement_registration
<where>
<if test="params.beginTime != null and params.beginTime != ''">
AND create_time = #{params.beginTime}
</if>
AND DATE_FORMAT( create_time, '%Y%m' ) = DATE_FORMAT( CURDATE(), '%Y%m' )
</where>
GROUP BY law_enforcement_item
</select>
<select id="statisticalLawEnforcer" parameterType="StatisticalVo" resultMap="StatisticalVoResult">
SELECT
law_enforcer,
count(*) AS total
FROM
enforcement_registration
WHERE
DATE_FORMAT( create_time, '%Y%m' ) = DATE_FORMAT( CURDATE(), '%Y%m' )
GROUP BY
law_enforcer_id UNION ALL
SELECT
law_enforcer_two,
count(*) AS total
FROM
enforcement_registration
WHERE
DATE_FORMAT( create_time, '%Y%m' ) = DATE_FORMAT( CURDATE(), '%Y%m' )
GROUP BY
law_enforcer_id_two
</select>
<select id="statisticalEnterpriseType" parameterType="StatisticalVo" resultMap="StatisticalVoResult">
SELECT
sdd.dict_label,
ei.enterprise_type,
count(*) AS total
FROM
enforcement_registration er
LEFT JOIN
enterprise_information ei
on er.enterprise_number = ei.enterprise_number
LEFT JOIN ( select dict_label,dict_value from sys_dict_data where dict_type = 'enterpriseType') sdd
on ei.enterprise_type = sdd.dict_value
WHERE
DATE_FORMAT( er.create_time, '%Y%m' ) = DATE_FORMAT( CURDATE(), '%Y%m' );
</select>
<select id="statisticalToMouth" parameterType="StatisticalVo" resultMap="StatisticalVoResult">
select
count(*) as total ,
COUNT(CASE WHEN is_complaint = 1 THEN 1 END) AS complaintCount
from enforcement_registration
WHERE
DATE_FORMAT(create_time, '%Y%m' ) = DATE_FORMAT( CURDATE(), '%Y%m' );
</select>
</mapper>
Loading…
Cancel
Save