优化调整

This commit is contained in:
mythxb 2023-06-04 16:30:09 +08:00
parent 5e5e4bf87a
commit f2da6eb2a1
27 changed files with 921 additions and 63 deletions

View File

@ -9,13 +9,13 @@ public class StreetCheckMsg {
@ExcelColumn(value = "街道名", col = 1) @ExcelColumn(value = "街道名", col = 1)
@ApiModelProperty("街道") @ApiModelProperty("地区")
private String orgName; private String orgName;
@ApiModelProperty("镇街用户数") @ApiModelProperty("用户数")
private Integer streetNum; private Integer streetNum;
@ApiModelProperty("社区用户数") @ApiModelProperty("用户数")
private Integer communityNum; private Integer communityNum;
@ExcelColumn(value = "企业总数", col = 2) @ExcelColumn(value = "企业总数", col = 2)

View File

@ -30,6 +30,10 @@ public interface DutyTreeMapper {
Integer delByUserId(@Param("userId") String userId, Integer delByUserId(@Param("userId") String userId,
@Param("targetType") Integer targetType); @Param("targetType") Integer targetType);
/*删除用户责任书*/
Integer delByTargetId(@Param("userId") String userId,
@Param("targetId") String targetId);
/*责任树*/ /*责任树*/
DutyTree findTree(@Param("targetType") Integer targetType, DutyTree findTree(@Param("targetType") Integer targetType,
@Param("userId") String userId, @Param("userId") String userId,

View File

@ -24,9 +24,9 @@ public class BookEntCheck implements Serializable {
private String chkbillid; private String chkbillid;
private String checksite; private String checksite;
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date begcheckdate; private Date begcheckdate;
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date endcheckdate; private Date endcheckdate;
private String checkuniy; private String checkuniy;
@ -79,11 +79,12 @@ public class BookEntCheck implements Serializable {
private Integer bookcheckscores; private Integer bookcheckscores;
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date createdon; private Date createdon;
private String createdby; private String createdby;
@JsonFormat(pattern = "yyyy-MM-dd")
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date modifiedon; private Date modifiedon;
private String modifiedby; private String modifiedby;

View File

@ -53,7 +53,7 @@ public class BookEntHT implements Serializable {
@ApiModelProperty("隐患名称") @ApiModelProperty("隐患名称")
private String hiddenarea; private String hiddenarea;
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
@ApiModelProperty("登记时间") @ApiModelProperty("登记时间")
@ExcelColumn(value = "登记时间",col = 4) @ExcelColumn(value = "登记时间",col = 4)
private Date confirmtime; private Date confirmtime;
@ -118,11 +118,11 @@ public class BookEntHT implements Serializable {
private String apprectifyimgbefore; private String apprectifyimgbefore;
private String apprectifyimgafter; private String apprectifyimgafter;
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date createdon; private Date createdon;
private String createdby; private String createdby;
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date modifiedon; private Date modifiedon;
private String modifiedby; private String modifiedby;

View File

@ -16,7 +16,7 @@ public class BookenthtCompany implements Serializable {
private String bookentcheckid; private String bookentcheckid;
@JsonFormat(pattern = "yyyy-MM-dd") @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date becheckedtime; private Date becheckedtime;
private String becheckedperson; private String becheckedperson;
@ -84,10 +84,12 @@ public class BookenthtCompany implements Serializable {
private String bookentcheckdetailid; private String bookentcheckdetailid;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date createdon; private Date createdon;
private String createdby; private String createdby;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
private Date modifiedon; private Date modifiedon;
private String modifiedby; private String modifiedby;

View File

@ -201,8 +201,7 @@ public class SysEnterprise implements Serializable {
@TableField("EstablishDate") @TableField("EstablishDate")
@ApiModelProperty("成立时间") @ApiModelProperty("成立时间")
@JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8") private String establishdate;
private Date establishdate;
@TableField("RiskLevel") @TableField("RiskLevel")
@ -901,11 +900,11 @@ public class SysEnterprise implements Serializable {
this.lrlinktel = lrlinktel; this.lrlinktel = lrlinktel;
} }
public Date getEstablishdate() { public String getEstablishdate() {
return establishdate; return establishdate;
} }
public void setEstablishdate(Date establishdate) { public void setEstablishdate(String establishdate) {
this.establishdate = establishdate; this.establishdate = establishdate;
} }

View File

@ -237,6 +237,11 @@
delete from duty_tree where user_id = #{userId} and target_type = #{targetType} delete from duty_tree where user_id = #{userId} and target_type = #{targetType}
</delete> </delete>
<!--删除用户责任书-->
<delete id="delByTargetId">
delete from duty_tree where user_id = #{userId} and target_id = #{targetId}
</delete>
<!--责任树--> <!--责任树-->
<select id="findTree" resultMap="BaseResultMap"> <select id="findTree" resultMap="BaseResultMap">
SELECT * FROM `duty_tree` dt SELECT * FROM `duty_tree` dt

View File

@ -689,13 +689,15 @@ and se.State = '启用'
<select id="checkSysOrg" resultMap="BaseResultMap"> <select id="checkSysOrg" resultMap="BaseResultMap">
SELECT so.*, SELECT so.*,
( (
select count(*) from SysEnterprise se where se.State = '启用' and (se.OrgCode = so.OrgCode or se.street_code = so.OrgCode or se.community_code = so.OrgCode) select count(*) from SysEnterprise se
where se.State = '启用'
and FIND_IN_SET(so.OrgCode,se.area_path)
)totalEnt, )totalEnt,
( (
select count(distinct bc.BaseEntId) from BookEntCheck bc select count(distinct bc.BaseEntId) from BookEntCheck bc
left join SysEnterprise se on se.SysEnterpriseId = bc.BaseEntId left join SysEnterprise se on se.SysEnterpriseId = bc.BaseEntId
where se.State = '启用' and (se.OrgCode = so.OrgCode or se.street_code = so.OrgCode or se.community_code = so.OrgCode) where se.State = '启用' and FIND_IN_SET(so.OrgCode,se.area_path)
<if test="null != startTime and '' != startTime"> <if test="null != startTime and '' != startTime">
and bc.CreatedOn >= #{startTime} and bc.CreatedOn >= #{startTime}
</if> </if>

View File

@ -811,7 +811,7 @@
( (
select count(*) select count(*)
from SysEnterprise se from SysEnterprise se
where se.street_code = so.OrgCode where FIND_IN_SET(so.OrgCode,se.area_path)
and se.State = '启用' and se.State = '启用'
<if test="null != inherentRisks and inherentRisks.size() > 0"> <if test="null != inherentRisks and inherentRisks.size() > 0">
and se.InherentRisk in and se.InherentRisk in
@ -824,7 +824,7 @@
select count(bc.BookEntCheckId) from BookEntCheck bc select count(bc.BookEntCheckId) from BookEntCheck bc
left join SysEnterprise se on bc.BaseEntId = se.SysEnterpriseId left join SysEnterprise se on bc.BaseEntId = se.SysEnterpriseId
where se.street_code = so.OrgCode and se.State = '启用' where FIND_IN_SET(so.OrgCode,se.area_path) and se.State = '启用'
<if test="null != inherentRisks and inherentRisks.size() > 0"> <if test="null != inherentRisks and inherentRisks.size() > 0">
and se.InherentRisk in and se.InherentRisk in
<foreach collection="inherentRisks" item="inherentRisk" open="(" close=")" separator=","> <foreach collection="inherentRisks" item="inherentRisk" open="(" close=")" separator=",">
@ -842,7 +842,7 @@
select count(distinct bc.BaseEntId) from BookEntCheck bc select count(distinct bc.BaseEntId) from BookEntCheck bc
left join SysEnterprise se on bc.BaseEntId = se.SysEnterpriseId left join SysEnterprise se on bc.BaseEntId = se.SysEnterpriseId
where se.street_code = so.OrgCode and se.State = '启用' where FIND_IN_SET(so.OrgCode,se.area_path) and se.State = '启用'
<if test="null != inherentRisks and inherentRisks.size() > 0"> <if test="null != inherentRisks and inherentRisks.size() > 0">
and se.InherentRisk in and se.InherentRisk in
<foreach collection="inherentRisks" item="inherentRisk" open="(" close=")" separator=","> <foreach collection="inherentRisks" item="inherentRisk" open="(" close=")" separator=",">
@ -859,7 +859,7 @@
( (
select count(be.BookEntHTId) from BookEntHT be select count(be.BookEntHTId) from BookEntHT be
left join SysEnterprise se on be.SysEnterpriseId = se.SysEnterpriseId left join SysEnterprise se on be.SysEnterpriseId = se.SysEnterpriseId
where se.street_code = so.OrgCode and se.State = '启用' where FIND_IN_SET(so.OrgCode,se.area_path) and se.State = '启用'
<if test="null != inherentRisks and inherentRisks.size() > 0"> <if test="null != inherentRisks and inherentRisks.size() > 0">
and se.InherentRisk in and se.InherentRisk in
<foreach collection="inherentRisks" item="inherentRisk" open="(" close=")" separator=","> <foreach collection="inherentRisks" item="inherentRisk" open="(" close=")" separator=",">
@ -876,7 +876,7 @@
( (
select count(be.BookEntHTId) from BookEntHT be select count(be.BookEntHTId) from BookEntHT be
left join SysEnterprise se on be.SysEnterpriseId = se.SysEnterpriseId left join SysEnterprise se on be.SysEnterpriseId = se.SysEnterpriseId
where se.street_code = so.OrgCode and se.State = '启用' where FIND_IN_SET(so.OrgCode,se.area_path) and se.State = '启用'
and be.HTState = '未整改' and be.HTState = '未整改'
<if test="null != inherentRisks and inherentRisks.size() > 0"> <if test="null != inherentRisks and inherentRisks.size() > 0">
and se.InherentRisk in and se.InherentRisk in
@ -894,7 +894,7 @@
( (
select count(be.BookEntHTId) from BookEntHT be select count(be.BookEntHTId) from BookEntHT be
left join SysEnterprise se on be.SysEnterpriseId = se.SysEnterpriseId left join SysEnterprise se on be.SysEnterpriseId = se.SysEnterpriseId
where se.street_code = so.OrgCode and se.State = '启用' where FIND_IN_SET(so.OrgCode,se.area_path) and se.State = '启用'
and be.HTState = '已整改' and be.HTState = '已整改'
<if test="null != inherentRisks and inherentRisks.size() > 0"> <if test="null != inherentRisks and inherentRisks.size() > 0">
and se.InherentRisk in and se.InherentRisk in
@ -912,7 +912,7 @@
( (
select count(be.BookEntHTId) from BookEntHT be select count(be.BookEntHTId) from BookEntHT be
left join SysEnterprise se on be.SysEnterpriseId = se.SysEnterpriseId left join SysEnterprise se on be.SysEnterpriseId = se.SysEnterpriseId
where se.street_code = so.OrgCode and se.State = '启用' where FIND_IN_SET(so.OrgCode,se.area_path) and se.State = '启用'
and be.HTState = '整改中' and be.HTState = '整改中'
<if test="null != inherentRisks and inherentRisks.size() > 0"> <if test="null != inherentRisks and inherentRisks.size() > 0">
and se.InherentRisk in and se.InherentRisk in
@ -1359,9 +1359,7 @@
<if test="null != endTime and '' != endTime"> <if test="null != endTime and '' != endTime">
and bc.CreatedOn &lt;= #{endTime} and bc.CreatedOn &lt;= #{endTime}
</if> </if>
and (se.OrgCode = #{areaCode} AND FIND_IN_SET(#{areaCode},se.area_path)
or se.street_code = #{areaCode}
or se.community_code = #{areaCode})
</select> </select>
<select id="countByRisk" resultType="java.lang.Integer"> <select id="countByRisk" resultType="java.lang.Integer">

View File

@ -450,7 +450,7 @@
<!--最小工作单元行业--> <!--最小工作单元行业-->
<select id="findByNameAndType" resultMap="BaseResultMap"> <select id="findByNameAndType" resultMap="BaseResultMap">
SELECT * FROM `BaseInClass` bc WHERE bc.`IndustryClassName` = #{industryClassName} AND bc.`in_type` = 2 SELECT * FROM `BaseInClass` bc WHERE bc.`IndustryClassName` = #{industryClassName}
</select> </select>
<!--多个行业--> <!--多个行业-->

View File

@ -627,7 +627,6 @@
safeTelephone = #{safeTelephone,jdbcType=VARCHAR}, safeTelephone = #{safeTelephone,jdbcType=VARCHAR},
safeManager = #{safeManager,jdbcType=VARCHAR}, safeManager = #{safeManager,jdbcType=VARCHAR},
PostCode = #{postcode,jdbcType=VARCHAR}, PostCode = #{postcode,jdbcType=VARCHAR},
qr_code = #{qrCode,jdbcType=VARCHAR},
EcoType = #{ecotype,jdbcType=VARCHAR}, EcoType = #{ecotype,jdbcType=VARCHAR},
PersonCount = #{personcount,jdbcType=INTEGER}, PersonCount = #{personcount,jdbcType=INTEGER},
EntLogoPic = #{entlogopic,jdbcType=VARCHAR}, EntLogoPic = #{entlogopic,jdbcType=VARCHAR},
@ -1265,7 +1264,7 @@
ON cp.`BookEntCheckId` = bc.`BookEntCheckId` ON cp.`BookEntCheckId` = bc.`BookEntCheckId`
WHERE cp.`SysUserId` = #{userId} WHERE cp.`SysUserId` = #{userId}
AND bc.`BaseEntId` = dt.target_id AND bc.`BaseEntId` = dt.target_id
AND DATE_FORMAT(cp.CreatedOn,'%Y-%m')=DATE_FORMAT(NOW(),'%Y-%m') AND DATE_FORMAT(cp.CreatedOn,'%Y')=DATE_FORMAT(NOW(),'%Y')
)checkNum )checkNum
FROM duty_tree dt FROM duty_tree dt
@ -2614,7 +2613,10 @@
</select> </select>
<select id="findEnterpriseByName" resultMap="BaseResultMap"> <select id="findEnterpriseByName" resultMap="BaseResultMap">
select sysent.EntName,sysent.state,sysent.SysEnterpriseId from ent_user eu left join sysenterprise sysent on eu.enterprise_id = sysent.SysEnterpriseId where eu.name = #{entUserName} select sysent.EntName,sysent.state,sysent.SysEnterpriseId
from ent_user eu
left join sysenterprise sysent on eu.enterprise_id = sysent.SysEnterpriseId
where eu.name = #{entUserName}
</select> </select>
<select id="findEnterpriseByPhoneNumber" resultMap="BaseResultMap"> <select id="findEnterpriseByPhoneNumber" resultMap="BaseResultMap">

View File

@ -2,6 +2,7 @@ package com.rzyc.controller;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.common.utils.*; import com.common.utils.*;
import com.common.utils.SMS.SendSMS;
import com.common.utils.copy.ObjectConversion; import com.common.utils.copy.ObjectConversion;
import com.common.utils.encryption.MD5; import com.common.utils.encryption.MD5;
import com.common.utils.encryption.PasswdFactory; import com.common.utils.encryption.PasswdFactory;
@ -1583,7 +1584,7 @@ public class BaseController {
}else if(2 == type){ }else if(2 == type){
sendexamineDangerMsg(enterpriseId,sysUserId); sendexamineDangerMsg(enterpriseId,sysUserId);
}else if(3 == type){ }else if(3 == type){
handelDanger(sysUserId,receiveId); handelDanger(sysUserId,receiveId,enterpriseId);
}else if(4 == type){ }else if(4 == type){
autographAuth(sysUserId,receiveId); autographAuth(sysUserId,receiveId);
}else if(5 == type){ }else if(5 == type){
@ -1663,6 +1664,19 @@ public class BaseController {
Jpush.sendGovAllNotifications(alias,content,map); Jpush.sendGovAllNotifications(alias,content,map);
//发送短信
SysUser user = sysUserMapper.selectByPrimaryKey(receiveId);
BookEntHT bookEntHT = bookEntHTMapper.selectByPrimaryKey(bookEntHtId);
if(null != user && StringUtils.isNotBlank(user.getMobiletel()) && null != bookEntHT){
SysEnterprise enterprise = sysEnterpriseMapper.selectByPrimaryKey(bookEntHT.getSysenterpriseid());
if(null != enterprise){
//发送短信
SendSMS.endDanger(user.getMobiletel(),enterprise.getEntname());
}
}
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
} }
@ -1853,7 +1867,7 @@ public class BaseController {
/** /**
* 隐患分配人员后 推送消息 * 隐患分配人员后 推送消息
*/ */
private void handelDanger(String sysUserId,String receiveId){ private void handelDanger(String sysUserId,String receiveId,String entId){
try { try {
//推送别名 //推送别名
String alias = ""; String alias = "";
@ -1873,6 +1887,15 @@ public class BaseController {
Jpush.sendAllNotifications(alias,content,map); Jpush.sendAllNotifications(alias,content,map);
} }
//发送短信
SysUser user = sysUserMapper.selectByPrimaryKey(sysUserId);
SysEnterprise enterprise = sysEnterpriseMapper.selectByPrimaryKey(entId);
if(null != user && StringUtils.isNotBlank(user.getMobiletel()) && null != enterprise){
//发送短信
SendSMS.endDanger(user.getMobiletel(),enterprise.getEntname());
}
}catch (Exception e){ }catch (Exception e){
e.printStackTrace(); e.printStackTrace();
} }

View File

@ -3,6 +3,7 @@ package com.rzyc.controller;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.common.utils.*; import com.common.utils.*;
import com.common.utils.SMS.SendSMS;
import com.common.utils.jwt.JwtUtil; import com.common.utils.jwt.JwtUtil;
import com.common.utils.model.*; import com.common.utils.model.*;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
@ -78,6 +79,10 @@ public class MinWorkController extends BaseController{
@ResponseBody @ResponseBody
public SingleResult companySelfBookEntHTClose(String htId,String entHtState,String sysEnterpriseId,String rectifyResult){ public SingleResult companySelfBookEntHTClose(String htId,String entHtState,String sysEnterpriseId,String rectifyResult){
SingleResult singleResult = new SingleResult(); SingleResult singleResult = new SingleResult();
bookenthtCompanyMapper.updateByKey(htId,entHtState,rectifyResult); bookenthtCompanyMapper.updateByKey(htId,entHtState,rectifyResult);
return singleResult; return singleResult;
} }

View File

@ -858,6 +858,7 @@ public class PcCompanyController extends BaseController{
@ApiImplicitParam(name = "id", value = "检查id", required = true, dataType = "string"), @ApiImplicitParam(name = "id", value = "检查id", required = true, dataType = "string"),
}) })
@ResponseBody @ResponseBody
@Transactional
public SingleResult<String> getCompanyCheckDetail(String id)throws Exception { public SingleResult<String> getCompanyCheckDetail(String id)throws Exception {
SingleResult singleResult = new SingleResult(); SingleResult singleResult = new SingleResult();
BookEntCheck bookEntCheck = bookEntCheckMapper.selectCheckDetail(id); BookEntCheck bookEntCheck = bookEntCheckMapper.selectCheckDetail(id);

View File

@ -2903,7 +2903,7 @@ public class BaseController {
entUser.setPostId(postId); entUser.setPostId(postId);
entUser.setEnterpriseId(enterprise.getSysenterpriseid()); entUser.setEnterpriseId(enterprise.getSysenterpriseid());
entUser.setAccount(enterprise.getEntname()); entUser.setAccount(enterprise.getEntname());
entUser.setName(enterprise.getLegalrepre()); entUser.setName(enterprise.getEntname());
entUser.setMobile(enterprise.getLrlinktel()); entUser.setMobile(enterprise.getLrlinktel());
entUser.setPostPath(postId); entUser.setPostPath(postId);
entUser.setPostPathName(entPost.getName()); entUser.setPostPathName(entPost.getName());

View File

@ -93,7 +93,7 @@ public class DynamicController extends com.rzyc.controller.BaseController {
NewsCnt newsCnt = newsCntMapper.findById(dynamicId); NewsCnt newsCnt = newsCntMapper.findById(dynamicId);
if(null != newsCnt){ if(null != newsCnt){
newsCnt.setCoverImage(setServiceFile(newsCnt.getCoverImage())); // newsCnt.setCoverImage(setServiceFile(newsCnt.getCoverImage()));
result.setData(newsCnt); result.setData(newsCnt);
}else{ }else{
result.setCode(Code.NO_DATA.getCode()); result.setCode(Code.NO_DATA.getCode());
@ -134,7 +134,8 @@ public class DynamicController extends com.rzyc.controller.BaseController {
newsCnt.setDelState(DelState.NOT_DEL.getState()); newsCnt.setDelState(DelState.NOT_DEL.getState());
//封面图 //封面图
newsCnt.setCoverImage(delServiceFile(changeDynamicDto.getShowImageUrl())); // newsCnt.setCoverImage(delServiceFile(changeDynamicDto.getShowImageUrl()));
newsCnt.setCoverImage(changeDynamicDto.getShowImageUrl());
newsCnt.setPublictime(DateUtils.parseString2Date(changeDynamicDto.getPublicTime(),"yyyy-MM-dd HH:mm")); newsCnt.setPublictime(DateUtils.parseString2Date(changeDynamicDto.getPublicTime(),"yyyy-MM-dd HH:mm"));

View File

@ -525,9 +525,9 @@ public class ExportContorller extends com.rzyc.controller.BaseController {
* @throws Exception * @throws Exception
*/ */
@ApiOperation(value = "导出企业二维码", notes = "导出企业二维码") @ApiOperation(value = "导出企业二维码", notes = "导出企业二维码")
@GetMapping(value = "/exportQrcode/{orgCode}") @GetMapping(value = "/exportQrcode")
@ResponseBody @ResponseBody
public void exportQrcode(@PathVariable String orgCode, String companyName, public void exportQrcode(String orgCode, String companyName,
String riskLevel, String inherentRiskStr, String riskLevel, String inherentRiskStr,
String baseinclassid, String baseinclassid,
HttpServletResponse response)throws Exception{ HttpServletResponse response)throws Exception{
@ -821,7 +821,7 @@ public class ExportContorller extends com.rzyc.controller.BaseController {
checkMsgs.add(streetCheckMsg); checkMsgs.add(streetCheckMsg);
} }
String excelName = "街道检查情况"+ DateUtils.getNowDateTimeStr("yyyyMMdd") +".xlsx"; String excelName = "检查情况"+ DateUtils.getNowDateTimeStr("yyyyMMdd") +".xlsx";
long t1 = System.currentTimeMillis(); long t1 = System.currentTimeMillis();
ExcelUtils.writeExcel(response, excelName,checkMsgs, StreetCheckMsg.class); ExcelUtils.writeExcel(response, excelName,checkMsgs, StreetCheckMsg.class);
long t2 = System.currentTimeMillis(); long t2 = System.currentTimeMillis();

View File

@ -5,6 +5,8 @@ import com.common.utils.RandomNumber;
import com.common.utils.StringUtils; import com.common.utils.StringUtils;
import com.common.utils.TypeConversion; import com.common.utils.TypeConversion;
import com.common.utils.encryption.PasswdFactory; import com.common.utils.encryption.PasswdFactory;
import com.common.utils.model.Code;
import com.common.utils.model.MultiResult;
import com.common.utils.model.SingleResult; import com.common.utils.model.SingleResult;
import com.rzyc.enums.UnitType; import com.rzyc.enums.UnitType;
import com.rzyc.model.*; import com.rzyc.model.*;
@ -588,7 +590,7 @@ public class ImportController extends com.rzyc.controller.BaseController {
//成立日期 //成立日期
cell = row.getCell((short)7); cell = row.getCell((short)7);
if(null != cell){ if(null != cell){
Date establishTime = cell.getDateCellValue(); String establishTime = dataFormatter.formatCellValue(cell);
sysEnterprise.setEstablishdate(establishTime); sysEnterprise.setEstablishdate(establishTime);
} }
@ -2452,7 +2454,7 @@ public class ImportController extends com.rzyc.controller.BaseController {
sysEnterpriseMapper.insert(enterprise); sysEnterpriseMapper.insert(enterprise);
} }
createEntUser(enterprise, "管理员",null); handleEetUser(enterprise.getSysenterpriseid());
//生成最小工作单元 //生成最小工作单元
saveEntWork(enterprise.getSysenterpriseid()); saveEntWork(enterprise.getSysenterpriseid());
@ -3104,5 +3106,589 @@ public class ImportController extends com.rzyc.controller.BaseController {
} }
/**
* 街道导入驻村干部
* @param multipartFile
* @return
* @throws Exception
*/
@ApiOperation(value = "街道导入驻村干部", notes = "街道导入驻村干部")
@RequestMapping(value = "/importAdminUser", method = RequestMethod.POST)
@ResponseBody
public SingleResult<String> importAdminUser(@RequestBody MultipartFile multipartFile)throws Exception{
SingleResult<String> result = new SingleResult<>();
if(null != multipartFile){
Workbook wookbook = WorkbookFactory.create(multipartFile.getInputStream());
Sheet sheet = wookbook.getSheetAt(0);
DataFormatter dataFormatter = new DataFormatter();
//获得表头
Row rowHead = sheet.getRow(0);
System.out.println("getPhysicalNumberOfCells -> "+rowHead.getPhysicalNumberOfCells());
//判断表头是否正确
if(true){
//获得数据的总行数
int totalRowNum = sheet.getLastRowNum();
if(totalRowNum > 0){
Boolean isSubject = true;
//获得所有数据
for(int i = 1 ; i <= totalRowNum ; i++){
int index = i+1;
//获得第i行对象
Row row = sheet.getRow(i);
if(null == row){
break;
}
String streetName = "";
String postName = "";
String userName = "";
String chinaName = "";
Cell cell = row.getCell((short)0);
if(null != cell){
streetName = dataFormatter.formatCellValue(cell);
}
cell = row.getCell((short)2);
if(null != cell){
postName = dataFormatter.formatCellValue(cell);
}
cell = row.getCell((short)3);
if(null != cell){
userName = dataFormatter.formatCellValue(cell);
}
cell = row.getCell((short)4);
if(null != cell){
chinaName = dataFormatter.formatCellValue(cell);
}
streetName = StringUtils.replaceBlank(streetName);
postName = StringUtils.replaceBlank(postName);
userName = StringUtils.replaceBlank(userName);
chinaName = StringUtils.replaceBlank(chinaName);
System.out.println(streetName+"-"+postName+"-"+userName+"-"+chinaName);
//
//区部门id
String districtUnitId = "fe4a2834-c754-4ed1-97db-4914c822d820";
//部门信息
SysUnit streetUnit = sysUnitMapper.findByUnitName(streetName,districtUnitId);
//
//
ListPerform perform = handleCadrePost(streetName,postName,chinaName);
System.out.println("perform -> "+perform.getListperformid());
SysUser sysUser = sysUserMapper.findBySysUserName(userName);
if(null == sysUser){
sysUser = new SysUser();
sysUser.setSysuserid(RandomNumber.getUUid());
sysUser.setUsertype("政府用户");
//区id
sysUser.setOrgcode(DISTRICT_ID);
//街道id
String streetCode = "";
SysOrg streetOrg = sysOrgMapper.findByName(streetName,DISTRICT_ID);
if(null != streetOrg){
streetCode = streetOrg.getOrgcode();
}
sysUser.setStreetCode(streetCode);
sysUser.setSysunitorentid(streetUnit.getSysunitid());
sysUser.setSysusername(userName);
sysUser.setChinaname(chinaName);
sysUser.setMobiletel(userName);
String passwd = PasswdFactory.encryptPasswd(sysUser.getSysuserid(), sysUser.getSysusername(), constantsConfigure.getDefaultPasswd());
sysUser.setSyspassword(passwd);
sysUser.setUserroles("295EF8C3-902F-41F0-95C8-D3AB9C6DA145");
sysUser.setSystitle(perform.getListperformid());
sysUser.setState("启用");
sysUser.setCreatedby("导入");
sysUser.setModifiedby("导入");
sysUser.setCreatedon(new Date());
sysUser.setModifiedon(new Date());
sysUserMapper.insert(sysUser);
}else{
//区id
sysUser.setOrgcode(DISTRICT_ID);
//街道id
String streetCode = "";
SysOrg streetOrg = sysOrgMapper.findByName(streetName,DISTRICT_ID);
if(null != streetOrg){
streetCode = streetOrg.getOrgcode();
}
sysUser.setStreetCode(streetCode);
sysUser.setMobiletel(userName);
sysUserMapper.changeMobile(sysUser);
}
}
}
}
}
return result;
}
/**
* 导入企业
* @param file
* @return
* @throws Exception
*/
@ApiOperation(value = "导入企业", notes = "导入企业")
@RequestMapping(value = "/importEnt", method = RequestMethod.POST)
@ResponseBody
public MultiResult<String> importEnt(@RequestBody MultipartFile file)throws Exception{
MultiResult<String> result = new MultiResult<>();
List<String> msgs = new ArrayList<>();
List<SysEnterprise> enterprises = new ArrayList<>();
if(null != file){
Workbook wookbook = WorkbookFactory.create(file.getInputStream());
Sheet sheet = wookbook.getSheetAt(0);
//获得表头
Row rowHead = sheet.getRow(0);
System.out.println("getPhysicalNumberOfCells -> "+rowHead.getPhysicalNumberOfCells());
//判断表头是否正确
if(true){
//获得数据的总行数
int totalRowNum = sheet.getLastRowNum();
if(totalRowNum > 0){
Boolean isSubject = true;
DataFormatter dataFormatter = new DataFormatter();
//获得所有数据
for(int i = 1 ; i <= totalRowNum ; i++){
//获得第i行对象
Row row = sheet.getRow(i);
if(null == row){
break;
}
System.out.println("i -------> "+i);
String entName = "";//名称
String orgpassno = "";//统一信用代码
String areaName = "";//地址
String addresss = "";//地址
String inName = "";//行业名
String name = "";//法人名
String mobile = "";//法人联系方式
String safeManager = "";//安全管理人员
String safeTelephone = "";//安全管理人员联系方式
String personCount = "";//从业人数
String establishdate = "";//成立日期
String manageType = "";//经营范围
Cell cell = row.getCell((short)1);
if(null != cell){
entName = dataFormatter.formatCellValue(cell);
}
cell = row.getCell((short)2);
if(null != cell){
orgpassno = dataFormatter.formatCellValue(cell);
}
cell = row.getCell((short)3);
if(null != cell){
areaName = dataFormatter.formatCellValue(cell);
}
cell = row.getCell((short)4);
if(null != cell){
addresss = dataFormatter.formatCellValue(cell);
}
cell = row.getCell((short)5);
if(null != cell){
inName = dataFormatter.formatCellValue(cell);
}
cell = row.getCell((short)6);
if(null != cell){
name = dataFormatter.formatCellValue(cell);
}
cell = row.getCell((short)7);
if(null != cell){
mobile = dataFormatter.formatCellValue(cell);
}
cell = row.getCell((short)8);
if(null != cell){
safeManager = dataFormatter.formatCellValue(cell);
}
cell = row.getCell((short)9);
if(null != cell){
safeTelephone = dataFormatter.formatCellValue(cell);
}
cell = row.getCell((short)10);
if(null != cell){
personCount = dataFormatter.formatCellValue(cell);
}
cell = row.getCell((short)11);
if(null != cell){
establishdate = dataFormatter.formatCellValue(cell);
}
cell = row.getCell((short)12);
if(null != cell){
manageType = dataFormatter.formatCellValue(cell);
}
System.out.println("entName --> "+entName);
System.out.println("orgpassno --> "+orgpassno);
System.out.println("areaName --> "+areaName);
System.out.println("addresss --> "+addresss);
System.out.println("inName --> "+inName);
System.out.println("name --> "+name);
System.out.println("mobile --> "+mobile);
System.out.println("safeManager --> "+safeManager);
System.out.println("safeTelephone --> "+safeTelephone);
System.out.println("personCount --> "+personCount);
System.out.println("establishdate --> "+establishdate);
System.out.println("manageType --> "+manageType);
if(StringUtils.isBlank(entName)){
msgs.add(""+i+"行企业名为空");
}
if(StringUtils.isBlank(areaName)){
msgs.add(""+i+"行所属市县为空");
}
if(StringUtils.isBlank(addresss)){
msgs.add(""+i+"行详情地址为空");
}
if(StringUtils.isBlank(inName)){
msgs.add(""+i+"行行业类型为空");
}
if(StringUtils.isBlank(name)){
msgs.add(""+i+"行法人或主要负责人为空");
}
if(StringUtils.isBlank(mobile)){
msgs.add(""+i+"行法人电话为空");
}
if(StringUtils.isNotBlank(entName) && StringUtils.isNotBlank(areaName) && StringUtils.isNotBlank(addresss)
&& StringUtils.isNotBlank(inName) && StringUtils.isNotBlank(name) && StringUtils.isNotBlank(mobile)){
SysEnterprise sysEnterprise = new SysEnterprise();
sysEnterprise.setEntname(entName);
sysEnterprise.setOrgpassno(orgpassno);
sysEnterprise.setAreaName(areaName);
sysEnterprise.setSysaddress(addresss);
sysEnterprise.setInClassName(inName);
sysEnterprise.setLegalrepre(name);
sysEnterprise.setLrlinktel(mobile);
sysEnterprise.setSafeManager(safeManager);
sysEnterprise.setSafeTelephone(safeTelephone);
sysEnterprise.setEstablishdate(establishdate);
sysEnterprise.setManageType(manageType);
if(StringUtils.isNotBlank(personCount)){
sysEnterprise.setPersoncount(TypeConversion.StringToInteger(personCount));
}
enterprises.add(sysEnterprise);
}
System.out.println();
}
}
}
}
if(msgs.size() > 0){
result.setCode(Code.ERROR.getCode());
result.setMessage("数据错误");
result.setData(msgs);
}else{
System.out.println("企业数量 --》 "+enterprises.size());
if(enterprises.size() > 0){
addEnt(enterprises);
}
}
return result;
}
/**
* 新增企业
* @version v1.0
* @author dong
* @date 2023/6/2 10:29
*/
public void addEnt(List<SysEnterprise> sysEnterprises)throws Exception{
for(SysEnterprise enterprise :sysEnterprises){
//更新
String orgCode = constantsConfigure.getSuperiorOrgCode();
enterprise.setOrgcode(orgCode);
//街道id
String streetCode = "";
SysOrg street = sysOrgMapper.findByName(enterprise.getAreaName(),orgCode);
if(null != street){
enterprise.setAreaCode(street.getOrgcode());
enterprise.setAreaPath(street.getParentPath());
enterprise.setAreaName(street.getParentName());
}
//最小工作行业
BaseInClass baseInClass = baseInClassMapper.findByNameAndType(enterprise.getInClassName());
if(null != baseInClass){
System.out.println(baseInClass.getIndustryclassname() + " - " + baseInClass.getBaseinclassid());
enterprise.setWorkClassId(baseInClass.getBaseinclassid());
}
//行业
BaseInClass inClass = baseInClassMapper.selectByName(enterprise.getInClassName());
if(null != inClass){
System.out.println(inClass.getIndustryclassname() + " - " + inClass.getBaseinclassid());
enterprise.setBaseinclassid(inClass.getBaseinclassid());
}
SysEnterprise company = sysEnterpriseMapper.findByName(enterprise.getEntname());
if (null != company) {
enterprise.setSysenterpriseid(company.getSysenterpriseid());
sysEnterpriseMapper.changeImportEnt(enterprise);
}else{
enterprise.setSysenterpriseid(RandomNumber.getUUid());
//如果二维码为空 则生成新的二维码
enterprise.setQrCode(entQrCode(enterprise.getSysenterpriseid()));
sysEnterpriseMapper.insert(enterprise);
//单位诊断
this.updateOrAddDiagnosis(100,enterprise.getSysenterpriseid(),"");
//新增企业
handleEetUser(enterprise.getSysenterpriseid());
}
//生成最小工作单元
saveEntWork(enterprise.getSysenterpriseid());
}
}
/**
* 导入责任树
* @param file
* @return
* @throws Exception
*/
@ApiOperation(value = "导入责任树", notes = "导入责任树")
@RequestMapping(value = "/importDutytree", method = RequestMethod.POST)
@ResponseBody
public MultiResult<String> importDutytree(@RequestBody MultipartFile file)throws Exception{
MultiResult<String> result = new MultiResult<>();
List<String> msgs = new ArrayList<>();
List<DutyTree> dutyTrees = new ArrayList<>();
if(null != file){
Workbook wookbook = WorkbookFactory.create(file.getInputStream());
Sheet sheet = wookbook.getSheetAt(0);
//获得表头
Row rowHead = sheet.getRow(0);
System.out.println("getPhysicalNumberOfCells -> "+rowHead.getPhysicalNumberOfCells());
//判断表头是否正确
if(true){
//获得数据的总行数
int totalRowNum = sheet.getLastRowNum();
if(totalRowNum > 0){
Boolean isSubject = true;
DataFormatter dataFormatter = new DataFormatter();
//获得所有数据
for(int i = 1 ; i <= totalRowNum ; i++){
//获得第i行对象
Row row = sheet.getRow(i);
if(null == row){
break;
}
System.out.println("i -------> "+i);
String dutyPerson = "";//名称
String dutyObject = "";//统一信用代码
String type = "";//地址
Cell cell = row.getCell((short)1);
if(null != cell){
dutyPerson = dataFormatter.formatCellValue(cell);
}
cell = row.getCell((short)2);
if(null != cell){
dutyObject = dataFormatter.formatCellValue(cell);
}
cell = row.getCell((short)3);
if(null != cell){
type = dataFormatter.formatCellValue(cell);
}
System.out.println("dutyPerson --> "+dutyPerson);
System.out.println("dutyObject --> "+dutyObject);
System.out.println("type --> "+type);
if(StringUtils.isBlank(dutyPerson)){
msgs.add(""+i+"行责任人(账号)为空");
}
if(StringUtils.isBlank(dutyObject)){
msgs.add(""+i+"行负责对象(账号或企业名)为空");
}
if(StringUtils.isBlank(type)){
msgs.add(""+i+"行类型为空");
}
if(StringUtils.isNotBlank(dutyPerson) && StringUtils.isNotBlank(dutyObject) && StringUtils.isNotBlank(type)){
DutyTree dutyTree = new DutyTree();
dutyTree.setUserId(dutyPerson);
dutyTree.setTargetId(dutyObject);
dutyTree.setDutyTreeId(type);
dutyTrees.add(dutyTree);
}
System.out.println();
}
}
}
}
if(dutyTrees.size() > 0){
for (DutyTree dutyTree : dutyTrees){
SysUser sysUser = sysUserMapper.findBySysUserName(dutyTree.getUserId());
if(null == sysUser){
msgs.add("<"+dutyTree.getUserId()+">该账号不存在,请核实。");
continue;
}else{
dutyTree.setUserId(sysUser.getSysuserid());
}
Integer targetType = 1;
String type = dutyTree.getDutyTreeId();
if("企业".equals(type)){
targetType = 2;
}
dutyTree.setTargetType(targetType);
if(1 == targetType){
SysUser user = sysUserMapper.findBySysUserName(dutyTree.getTargetId());
if(null == user){
msgs.add("<"+dutyTree.getTargetId()+">该账号不存在,请核实。");
continue;
}else{
dutyTree.setTargetId(user.getSysuserid());
}
}else{
SysEnterprise enterprise = sysEnterpriseMapper.findByName(dutyTree.getTargetId());
if(null == enterprise){
msgs.add("<"+dutyTree.getTargetId()+">该企业不存在,请核实。");
continue;
}else{
dutyTree.setTargetId(enterprise.getSysenterpriseid());
}
}
dutyTree.setDutyTreeId(RandomNumber.getUUid());
dutyTree.setModified("excel");
dutyTree.setModifyTime(new Date());
dutyTree.setCreated("excel");
dutyTree.setCreateTime(new Date());
dutyTreeMapper.delByTargetId(dutyTree.getUserId(),dutyTree.getTargetId());
dutyTreeMapper.insert(dutyTree);
}
}
if(msgs.size() > 0){
result.setCode(Code.ERROR.getCode());
result.setMessage("数据错误");
result.setData(msgs);
}
return result;
}
} }

View File

@ -1,8 +1,10 @@
package com.rzyc.controller; package com.rzyc.controller;
import cn.jpush.api.push.model.SMS;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONArray;
import com.common.utils.*; import com.common.utils.*;
import com.common.utils.SMS.SendSMS;
import com.common.utils.jwt.JwtUtil; import com.common.utils.jwt.JwtUtil;
import com.common.utils.model.*; import com.common.utils.model.*;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
@ -1078,6 +1080,10 @@ public class MinWorkController extends BaseController{
//如果推送消息状态为1 则推送消息 //如果推送消息状态为1 则推送消息
if(1 == sendMsgStatus){ if(1 == sendMsgStatus){
//发送短信
SendSMS.findDanger(sysEnterprise.getLrlinktel());
SendMessage sendMessage = new SendMessage(sysUserId,baseEntId,1); SendMessage sendMessage = new SendMessage(sysUserId,baseEntId,1);
Thread thread = new Thread(sendMessage); Thread thread = new Thread(sendMessage);
thread.start(); thread.start();

View File

@ -1233,7 +1233,7 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
//记录履职记录 //记录履职记录
ListFactor listFactor = listFactorMapper.selectByPrimaryKey(listfactorid); ListFactor listFactor = listFactorMapper.selectByPrimaryKey(listfactorid);
if(null != listFactor){ if(null != listFactor){
String content = "新增履职记录:"+listDetail.getWorkcnt(); String content = "新增履职记录:"+addPerformRecordDto.getWorkcnt();
addListChange(listFactor.getListperformid(),listFactor.getListfactorid(),content); addListChange(listFactor.getListperformid(),listFactor.getListfactorid(),content);
} }

View File

@ -6,6 +6,8 @@ import com.common.utils.encryption.PasswdFactory;
import com.common.utils.excel.ExcelUtils; import com.common.utils.excel.ExcelUtils;
import com.common.utils.jwt.JwtUtil; import com.common.utils.jwt.JwtUtil;
import com.common.utils.model.*; import com.common.utils.model.*;
import com.common.utils.upload.FileUpload;
import com.common.utils.upload.ZipUtils;
import com.github.pagehelper.Page; import com.github.pagehelper.Page;
import com.github.pagehelper.PageHelper; import com.github.pagehelper.PageHelper;
import com.rzyc.advice.LoginAuth; import com.rzyc.advice.LoginAuth;
@ -42,6 +44,8 @@ import org.springframework.web.bind.annotation.*;
import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpServletResponse;
import javax.validation.Valid; import javax.validation.Valid;
import java.io.*;
import java.net.URL;
import java.sql.Timestamp; import java.sql.Timestamp;
import java.text.NumberFormat; import java.text.NumberFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@ -663,12 +667,12 @@ public class PcCompanyController extends com.rzyc.controller.BaseController {
return singleResult; return singleResult;
} }
EntUser eu = entUserMapper.validAccount(sysEnterprise.getLrlinktel(),null); // EntUser eu = entUserMapper.validAccount(sysEnterprise.getLrlinktel(),null);
if (null != eu){ // if (null != eu){
singleResult.setMessage(Message.MOBILE_IS_CREATED); // singleResult.setMessage(Message.MOBILE_IS_CREATED);
singleResult.setCode(Code.ERROR.getCode()); // singleResult.setCode(Code.ERROR.getCode());
return singleResult; // return singleResult;
} // }
getEntAreaCode(sysEnterpriseDo.getAreaCode(),sysEnterprise); getEntAreaCode(sysEnterpriseDo.getAreaCode(),sysEnterprise);
sysEnterprise.setCreatedon(new Date()); sysEnterprise.setCreatedon(new Date());
@ -711,6 +715,7 @@ public class PcCompanyController extends com.rzyc.controller.BaseController {
singleResult.setCode(Code.ERROR.getCode()); singleResult.setCode(Code.ERROR.getCode());
return singleResult; return singleResult;
} }
EntUser eu = entUserMapper.validAccountByEntId(sysEnterprise.getLrlinktel(),null,sysEnterpriseDo.getSysenterpriseid()); EntUser eu = entUserMapper.validAccountByEntId(sysEnterprise.getLrlinktel(),null,sysEnterpriseDo.getSysenterpriseid());
if (null != eu){ if (null != eu){
singleResult.setMessage(Message.MOBILE_IS_CREATED); singleResult.setMessage(Message.MOBILE_IS_CREATED);
@ -1325,7 +1330,100 @@ public class PcCompanyController extends com.rzyc.controller.BaseController {
} }
/**
* 导出企业二维码
* @throws Exception
*/
@ApiOperation(value = "导出企业二维码", notes = "导出企业二维码")
@GetMapping(value = "/exportQrcode")
@ResponseBody
public void exportQrcode(String orgCode, String companyName,
String riskLevel, String inherentRiskStr,
String baseinclassid,
String userId,
HttpServletResponse response)throws Exception{
String time = DateUtils.getNowDateTimeStr("yyyyMMddHHmmss");
//正式服
// String baseFolder = "/usr/local/app/resource/zip";
String baseFolder = constantsConfigure.getZipPath();
//测试
// String baseFolder = "C:/mnt/resource/zip/";
//压缩包位置
String zippath = baseFolder+"/"+time+"/qrcode.zip";
//二维码存放位置
String folder = baseFolder+"/"+time+"/qrcode/";
//二维码位置
//测试
// String fileHeader = "http://110.188.70.195:8014";
//服务器
String fileHeader = constantsConfigure.getServiceFileHeader();
//用户的归属地
String areaCode = getUserArea(userId);
List<Integer> inherentRisks = new ArrayList<>();
//风险等级
if(StringUtils.isNotBlank(inherentRiskStr)){
for (String str : inherentRiskStr.split(",")){
inherentRisks.add(TypeConversion.StringToInteger(str));
}
}
if(StringUtils.isBlank(orgCode)){
orgCode = areaCode;
}
List<SysEnterprise> enterprises = sysEnterpriseMapper.selectPCList(orgCode,companyName,riskLevel,null,baseinclassid,inherentRisks);
for (SysEnterprise enterprise : enterprises){
if(StringUtils.isNotBlank(enterprise.getQrCode())){
System.out.println(enterprise.getQrCode());
String qrcodeUrl = fileHeader + enterprise.getQrCode();
URL url = new URL(qrcodeUrl);
String entName = enterprise.getEntname();
entName = StringUtils.replaceBlank(entName);
String fileName = entName+".png";
String zipFolder = folder;
if(StringUtils.isNotBlank(enterprise.getCommunityName())){
zipFolder = zipFolder+enterprise.getCommunityName()+"/";
}
FileUpload.saveQrcoe(url.openConnection().getInputStream(),zipFolder,fileName);
}
}
FileOutputStream fos1= new FileOutputStream(new File(zippath));
ZipUtils.toZip(folder, fos1,true);
File file = new File(zippath);
// 取得文件名
String filename = file.getName();
// 取得文件的后缀名
String ext = filename.substring(filename.lastIndexOf(".") + 1).toUpperCase();
// 以流的形式下载文件
InputStream fis = new BufferedInputStream(new FileInputStream(zippath));
byte[] buffer = new byte[fis.available()];
fis.read(buffer);
fis.close();
// 清空response
response.reset();
// 设置response的Header
response.addHeader("Content-Disposition", "attachment;filename=" + new String(filename.getBytes()));
response.addHeader("Content-Length", "" + file.length());
OutputStream toClient = new BufferedOutputStream(response.getOutputStream());
response.setContentType("application/octet-stream");
toClient.write(buffer);
toClient.flush();
toClient.close();
}

View File

@ -62,7 +62,10 @@ public class SaveEntListThread implements Runnable{
in.setCreateBy(userId); in.setCreateBy(userId);
in.setCreateTime(new Date()); in.setCreateTime(new Date());
} }
int deleteNumber = inEntListMapper.deleteByEnterpriseId(companyId); int deleteNumber = inEntListMapper.deleteByEnterpriseId(companyId);
if(null != entLists && entLists.size() > 0){
int result = inEntListMapper.insertList(entLists); int result = inEntListMapper.insertList(entLists);
} }
}
} }

View File

@ -125,11 +125,13 @@ public class SaveEntPostAndUserThread implements Runnable {
entUser.setEntUserId(userId); entUser.setEntUserId(userId);
entUser.setPostId(postId); entUser.setPostId(postId);
entUser.setEnterpriseId(enterpriseId); entUser.setEnterpriseId(enterpriseId);
if (copyOnWriteArrayList.contains(phone)){
entUser.setAccount(entName); entUser.setAccount(entName);
}else { // if (copyOnWriteArrayList.contains(phone)){
entUser.setAccount(phone); // entUser.setAccount(entName);
} // }else {
// entUser.setAccount(phone);
// }
entUser.setName(name); entUser.setName(name);
entUser.setMobile(phone); entUser.setMobile(phone);
entUser.setPostPath(postId); entUser.setPostPath(postId);

View File

@ -165,7 +165,9 @@ public class SaveIndustryPostThread implements Runnable {
} }
private void finishLastList(){ private void finishLastList(){
if(null != entPostDutyList && entPostDutyList.size() > 0){
entPostDutyMapper.insertList(entPostDutyList); entPostDutyMapper.insertList(entPostDutyList);
}
entPostDutyList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT); entPostDutyList = ListUtils.newArrayListWithExpectedSize(BATCH_COUNT);
} }

View File

@ -63,7 +63,7 @@ onstants:
#上传文件公共地址 #上传文件公共地址
file_header: /static/resource/inventory/uploadFile/ file_header: /static/resource/inventory/uploadFile/
#上传文件基础路径 #上传文件基础路径
service_file_header: http://172.27.181.247/ service_file_header: http://172.27.181.247:8010/
#父级地区id #父级地区id
superior_org_code: 513300 superior_org_code: 513300
#动态详情基础地址 #动态详情基础地址
@ -83,11 +83,11 @@ onstants:
#企业账号默认密码 #企业账号默认密码
default_passwd: csaq512000 default_passwd: csaq512000
#公示牌 #公示牌
gsp_path: /static/rzyc/resource/inventory/gsp.xlsx gsp_path: /static/resource/inventory/gsp.xlsx
#zip下载地址 #zip下载地址
zip_path: /static/rzyc/resource/inventory/zip zip_path: /static/resource/inventory/zip
#导出word模板路径 #导出word模板路径
word_tmp: /static/rzyc/resource/inventory/wordtmp word_tmp: /static/resource/inventory/wordtmp

View File

@ -1,5 +1,6 @@
package com.common.utils.SMS; package com.common.utils.SMS;
import com.common.utils.httpClient.WebUtils;
import com.common.utils.httpClient.WebUtilsOld; import com.common.utils.httpClient.WebUtilsOld;
import java.util.HashMap; import java.util.HashMap;
@ -44,4 +45,72 @@ public class SendSMS {
e.printStackTrace(); e.printStackTrace();
} }
} }
/**
* 隐患审核短信
* @version v1.0
* @author dong
* @date 2023/6/2 15:34
*/
public static void endDanger(String mobile,String entName)throws Exception{
try {
String url = "http://118.122.253.78:20025";
Map<String,String> params = new HashMap<>();
params.put("modalId","1819647");
params.put("tels",mobile);
params.put("msg",entName);
params.put("ext","");
Map<String,String> headers = new HashMap<>();
String resutlStr = WebUtils.doPost(url, params,headers);
System.out.println("resutlStr --> "+resutlStr);
}catch (Exception e){
e.printStackTrace();
}
}
/**
* 隐患审核短信
* @version v1.0
* @author dong
* @date 2023/6/2 15:34
*/
public static void taskInfo(String mobile)throws Exception{
try {
String url = "http://118.122.253.78:20025";
Map<String,String> params = new HashMap<>();
params.put("modalId","1819654");
params.put("tels",mobile);
params.put("msg","履职清单任务即将超期,请及时完成。");
params.put("ext","");
Map<String,String> headers = new HashMap<>();
String resutlStr = WebUtils.doPost(url, params,headers);
System.out.println("resutlStr --> "+resutlStr);
}catch (Exception e){
e.printStackTrace();
}
}
/**
* 隐患审核短信
* @version v1.0
* @author dong
* @date 2023/6/2 15:34
*/
public static void findDanger(String mobile)throws Exception{
try {
String url = "http://118.122.253.78:20025";
Map<String,String> params = new HashMap<>();
params.put("modalId","1819654");
params.put("tels",mobile);
params.put("msg","企业接收到隐患信息,请及时整改并上传整改信息。");
params.put("ext","");
Map<String,String> headers = new HashMap<>();
String resutlStr = WebUtils.doPost(url, params,headers);
System.out.println("resutlStr --> "+resutlStr);
}catch (Exception e){
e.printStackTrace();
}
}
} }

View File

@ -1,5 +1,6 @@
package com.common.utils.httpClient; package com.common.utils.httpClient;
import com.alibaba.fastjson.JSONArray;
import com.common.utils.Constants; import com.common.utils.Constants;
import com.common.utils.StringUtils; import com.common.utils.StringUtils;
import org.apache.http.Consts; import org.apache.http.Consts;
@ -20,12 +21,13 @@ import org.apache.http.message.BasicNameValuePair;
import org.apache.http.params.HttpConnectionParams; import org.apache.http.params.HttpConnectionParams;
import org.apache.http.util.EntityUtils; import org.apache.http.util.EntityUtils;
import java.io.File; import java.io.*;
import java.io.IOException; import java.net.HttpURLConnection;
import java.io.InputStream;
import java.net.URI; import java.net.URI;
import java.net.URL;
import java.nio.charset.Charset; import java.nio.charset.Charset;
import java.time.Duration; import java.time.Duration;
import java.util.HashMap;
import java.util.LinkedList; import java.util.LinkedList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
@ -141,6 +143,53 @@ public class WebUtils {
} }
/**
* HttpPost请求
* @param vUrl 请求地址
* @param content 参数内容
* @param content_type 报文类型
* @return
*/
public static String httpPost(String vUrl, String content,String content_type) {
try {
URL url = new URL(vUrl);
HttpURLConnection httpconn = (HttpURLConnection) url.openConnection();
httpconn.setRequestProperty("encoding", "UTF-8");// 添加请求属性
if(!content_type.equals("")){
httpconn.setRequestProperty("Content-Type", content_type);
}
httpconn.setDoInput(true);// 允许输入
httpconn.setDoOutput(true);// 允许输出
httpconn.setRequestMethod("POST");// POST请求 要在获取输入输出流之前设置 否则报错
// 输出
OutputStream os = httpconn.getOutputStream();
OutputStreamWriter osw = new OutputStreamWriter(os, "UTF-8");
BufferedWriter bw = new BufferedWriter(osw);
bw.write(content);
bw.flush();
// 输入
InputStream in = httpconn.getInputStream();
InputStreamReader isr = new InputStreamReader(in, "UTF-8");
BufferedReader br = new BufferedReader(isr);
String line;
StringBuilder sb = new StringBuilder();
while ((line = br.readLine()) != null) {
sb.append(line);
}
bw.close();
osw.close();
os.close();
br.close();
isr.close();
in.close();
return sb.toString();
} catch (Exception e) {
e.printStackTrace();
return null;
}
}
} }