新兴行业清单导入

This commit is contained in:
mythxb 2023-12-26 15:12:40 +08:00
parent 9e84e0b1d4
commit 8df2f8b949
8 changed files with 101 additions and 22 deletions

View File

@ -0,0 +1,35 @@
package com.rzyc.bean.user.dto;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
/**
* @author dong
* @date 2023-12-26 14:01
* @Version V1.0
*/
@ApiModel("职责清单")
public class ListSafeDto {
@ApiModelProperty(value = "岗位id",required = true)
private String listperformId;
@ApiModelProperty("关键字")
private String condition;
public String getListperformId() {
return listperformId;
}
public void setListperformId(String listperformId) {
this.listperformId = listperformId;
}
public String getCondition() {
return condition;
}
public void setCondition(String condition) {
this.condition = condition;
}
}

View File

@ -39,7 +39,8 @@ public interface ListSafeMapper {
int updateByPrimaryKey(ListSafe record); int updateByPrimaryKey(ListSafe record);
/*用户职责*/ /*用户职责*/
List<ListSafeWithBLOBs> userListSafe(@Param("listPerformId") String listPerformId); List<ListSafeWithBLOBs> userListSafe(@Param("listPerformId") String listPerformId,
@Param("condition") String condition);
/*查询部门局长的职责*/ /*查询部门局长的职责*/
List<ListSafe> othListSafe(@Param("supClassId") String supClassId); List<ListSafe> othListSafe(@Param("supClassId") String supClassId);

View File

@ -1,5 +1,6 @@
package com.rzyc.model.user; package com.rzyc.model.user;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty; import io.swagger.annotations.ApiModelProperty;
@ -32,10 +33,12 @@ public class ListSafe implements Serializable {
private Date applydate; private Date applydate;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date createdon; private Date createdon;
private String createdby; private String createdby;
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
private Date modifiedon; private Date modifiedon;
private String modifiedby; private String modifiedby;

View File

@ -417,7 +417,11 @@
<!--用户职责--> <!--用户职责-->
<select id="userListSafe" resultMap="ResultMapWithBLOBs"> <select id="userListSafe" resultMap="ResultMapWithBLOBs">
SELECT * FROM `ListSafe` ls WHERE ls.`ListPerformId` = #{listPerformId} SELECT * FROM `ListSafe` ls
WHERE ls.`ListPerformId` = #{listPerformId}
<if test="null != condition and '' != condition">
and ls.SafeDuty like #{condition}
</if>
ORDER BY ls.SortId ASC,ls.CreatedOn ASC ORDER BY ls.SortId ASC,ls.CreatedOn ASC
</select> </select>

View File

@ -70,7 +70,7 @@ public class ImportController extends com.rzyc.controller.BaseController {
@ApiOperation(value = "导入新兴行业职责", notes = "导入新兴行业职责") @ApiOperation(value = "导入新兴行业职责", notes = "导入新兴行业职责")
@RequestMapping(value = "/risingData", method = RequestMethod.POST) @RequestMapping(value = "/risingData", method = RequestMethod.POST)
@ResponseBody @ResponseBody
public SingleResult<String> risingData(@RequestBody MultipartFile multipartFile)throws Exception{ public SingleResult<String> risingData(@RequestBody MultipartFile multipartFile,Integer cellNum)throws Exception{
SingleResult<String> result = new SingleResult<>(); SingleResult<String> result = new SingleResult<>();
Workbook wookbook = WorkbookFactory.create(multipartFile.getInputStream()); Workbook wookbook = WorkbookFactory.create(multipartFile.getInputStream());
Sheet sheet = wookbook.getSheetAt(0); Sheet sheet = wookbook.getSheetAt(0);
@ -99,7 +99,7 @@ public class ImportController extends com.rzyc.controller.BaseController {
Cell cell = row.getCell((short)1); Cell cell = row.getCell((short)1);
for (int j = 1;j<=13;j++){ for (int j = 1;j<=cellNum;j++){
cell = row.getCell((short)j); cell = row.getCell((short)j);
String str = dataFormatter.formatCellValue(cell); String str = dataFormatter.formatCellValue(cell);
str = StringUtils.replaceBlank(str); str = StringUtils.replaceBlank(str);
@ -125,7 +125,7 @@ public class ImportController extends com.rzyc.controller.BaseController {
System.out.println("unitName ----> "+unitName); System.out.println("unitName ----> "+unitName);
ListPerform perform = listPerformMapper.findByName(unitName,"5bd164aa-dd43-45e3-a5a2-649bb2fd9fb9"); ListPerform perform = listPerformMapper.findByName(unitName,"5bd164aa-dd43-45e3-a5a2-649bb2fd9fb9");
if(null != perform){ if(null != perform){
for (int k = 1;k<=13;k++){ for (int k = 1;k<=cellNum;k++){
cell = row.getCell((short)k); cell = row.getCell((short)k);
String listStr = dataFormatter.formatCellValue(cell); String listStr = dataFormatter.formatCellValue(cell);
listStr = StringUtils.replaceBlank(listStr); listStr = StringUtils.replaceBlank(listStr);

View File

@ -502,7 +502,7 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
MultiResult<ListSafeWithBLOBs> result = new MultiResult<>(); MultiResult<ListSafeWithBLOBs> result = new MultiResult<>();
SysUser sysUser = sysUserMapper.selectByPrimaryKey(userId); SysUser sysUser = sysUserMapper.selectByPrimaryKey(userId);
if(null != sysUser && StringUtils.isNotBlank(sysUser.getSystitle())){ if(null != sysUser && StringUtils.isNotBlank(sysUser.getSystitle())){
List<ListSafeWithBLOBs> listSafes = listSafeMapper.userListSafe(sysUser.getSystitle()); List<ListSafeWithBLOBs> listSafes = listSafeMapper.userListSafe(sysUser.getSystitle(),"");
if(null != listSafes && listSafes.size() > 0){ if(null != listSafes && listSafes.size() > 0){
result.setData(listSafes); result.setData(listSafes);
}else{ }else{
@ -2094,7 +2094,7 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
@ResponseBody @ResponseBody
public MultiResult<ListSafeWithBLOBs> performSafe(String listperformId)throws Exception{ public MultiResult<ListSafeWithBLOBs> performSafe(String listperformId)throws Exception{
MultiResult<ListSafeWithBLOBs> result = new MultiResult<>(); MultiResult<ListSafeWithBLOBs> result = new MultiResult<>();
List<ListSafeWithBLOBs> listSafes = listSafeMapper.userListSafe(listperformId); List<ListSafeWithBLOBs> listSafes = listSafeMapper.userListSafe(listperformId,"");
if(listSafes.size() > 0){ if(listSafes.size() > 0){
Integer sortId = 1; Integer sortId = 1;
for (ListSafeWithBLOBs listSafe : listSafes){ for (ListSafeWithBLOBs listSafe : listSafes){
@ -2111,6 +2111,27 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
return result; return result;
} }
/**
* 岗位安全生产职责清单分页
* @version v1.0
* @author dong
* @date 2023/12/26 14:11
*/
@LoginAuth
@ApiOperation(value = "岗位安全生产职责清单分页", notes = "岗位安全生产职责清单分页")
@GetMapping(value = "performSafePage")
@ResponseBody
public SingleResult<Pager<ListSafeWithBLOBs>> performSafePage(@Valid ListSafeDto listSafeDto,@Valid PageDto pageDto)throws Exception{
SingleResult<Pager<ListSafeWithBLOBs>> result = new SingleResult<>();
String condition = TypeConversion.getConditionV1(listSafeDto.getCondition());
PageHelper.startPage(pageDto.getPage(), pageDto.getPageSize());
Page<ListSafeWithBLOBs> page = (Page<ListSafeWithBLOBs>)listSafeMapper.userListSafe(listSafeDto.getListperformId(),condition);
Pager<ListSafeWithBLOBs> pager = new Pager<>();
getDatePage(pager,page);
result.setData(pager);
return result;
}
/** /**
* 修改新增安全生产职责清单 * 修改新增安全生产职责清单

View File

@ -595,7 +595,7 @@ public class WxContorller extends com.rzyc.controller.BaseController {
MultiResult<ListSafeWithBLOBs> result = new MultiResult<>(); MultiResult<ListSafeWithBLOBs> result = new MultiResult<>();
SysUser sysUser = sysUserMapper.selectByPrimaryKey(userId); SysUser sysUser = sysUserMapper.selectByPrimaryKey(userId);
if(null != sysUser && StringUtils.isNotBlank(sysUser.getSystitle())){ if(null != sysUser && StringUtils.isNotBlank(sysUser.getSystitle())){
List<ListSafeWithBLOBs> userListSafe = listSafeMapper.userListSafe(sysUser.getSystitle()); List<ListSafeWithBLOBs> userListSafe = listSafeMapper.userListSafe(sysUser.getSystitle(),"");
result.setData(userListSafe); result.setData(userListSafe);
} }
return result; return result;

View File

@ -132,6 +132,21 @@ public class TypeConversion {
return condition; return condition;
} }
/**
* 处理字符串 在字符串前面和后面加 %
* @param condition
* @return
* @throws Exception
*/
public static String getConditionV1(String condition) {
if (StringUtils.isNotBlank(condition)) {
condition = condition.replace(" ","");
condition = condition.replace("\t","");
condition = "%" + condition + "%";
}
return condition;
}
/** /**
- listToTree - listToTree