新兴行业清单导入
This commit is contained in:
parent
9e84e0b1d4
commit
8df2f8b949
|
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
|
@ -39,7 +39,8 @@ public interface ListSafeMapper {
|
|||
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);
|
||||
|
|
|
|||
|
|
@ -1,5 +1,6 @@
|
|||
package com.rzyc.model.user;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import io.swagger.annotations.ApiModel;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
|
||||
|
|
@ -32,10 +33,12 @@ public class ListSafe implements Serializable {
|
|||
|
||||
private Date applydate;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date createdon;
|
||||
|
||||
private String createdby;
|
||||
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date modifiedon;
|
||||
|
||||
private String modifiedby;
|
||||
|
|
|
|||
|
|
@ -417,7 +417,11 @@
|
|||
|
||||
<!--用户职责-->
|
||||
<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
|
||||
</select>
|
||||
|
||||
|
|
|
|||
|
|
@ -70,7 +70,7 @@ public class ImportController extends com.rzyc.controller.BaseController {
|
|||
@ApiOperation(value = "导入新兴行业职责", notes = "导入新兴行业职责")
|
||||
@RequestMapping(value = "/risingData", method = RequestMethod.POST)
|
||||
@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<>();
|
||||
Workbook wookbook = WorkbookFactory.create(multipartFile.getInputStream());
|
||||
Sheet sheet = wookbook.getSheetAt(0);
|
||||
|
|
@ -99,7 +99,7 @@ public class ImportController extends com.rzyc.controller.BaseController {
|
|||
|
||||
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);
|
||||
String str = dataFormatter.formatCellValue(cell);
|
||||
str = StringUtils.replaceBlank(str);
|
||||
|
|
@ -125,7 +125,7 @@ public class ImportController extends com.rzyc.controller.BaseController {
|
|||
System.out.println("unitName ----> "+unitName);
|
||||
ListPerform perform = listPerformMapper.findByName(unitName,"5bd164aa-dd43-45e3-a5a2-649bb2fd9fb9");
|
||||
if(null != perform){
|
||||
for (int k = 1;k<=13;k++){
|
||||
for (int k = 1;k<=cellNum;k++){
|
||||
cell = row.getCell((short)k);
|
||||
String listStr = dataFormatter.formatCellValue(cell);
|
||||
listStr = StringUtils.replaceBlank(listStr);
|
||||
|
|
|
|||
|
|
@ -502,7 +502,7 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
|||
MultiResult<ListSafeWithBLOBs> result = new MultiResult<>();
|
||||
SysUser sysUser = sysUserMapper.selectByPrimaryKey(userId);
|
||||
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){
|
||||
result.setData(listSafes);
|
||||
}else{
|
||||
|
|
@ -2094,7 +2094,7 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
|||
@ResponseBody
|
||||
public MultiResult<ListSafeWithBLOBs> performSafe(String listperformId)throws Exception{
|
||||
MultiResult<ListSafeWithBLOBs> result = new MultiResult<>();
|
||||
List<ListSafeWithBLOBs> listSafes = listSafeMapper.userListSafe(listperformId);
|
||||
List<ListSafeWithBLOBs> listSafes = listSafeMapper.userListSafe(listperformId,"");
|
||||
if(listSafes.size() > 0){
|
||||
Integer sortId = 1;
|
||||
for (ListSafeWithBLOBs listSafe : listSafes){
|
||||
|
|
@ -2111,6 +2111,27 @@ public class PcPersonalController extends com.rzyc.controller.BaseController {
|
|||
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;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 修改新增安全生产职责清单
|
||||
|
|
|
|||
|
|
@ -595,7 +595,7 @@ public class WxContorller extends com.rzyc.controller.BaseController {
|
|||
MultiResult<ListSafeWithBLOBs> result = new MultiResult<>();
|
||||
SysUser sysUser = sysUserMapper.selectByPrimaryKey(userId);
|
||||
if(null != sysUser && StringUtils.isNotBlank(sysUser.getSystitle())){
|
||||
List<ListSafeWithBLOBs> userListSafe = listSafeMapper.userListSafe(sysUser.getSystitle());
|
||||
List<ListSafeWithBLOBs> userListSafe = listSafeMapper.userListSafe(sysUser.getSystitle(),"");
|
||||
result.setData(userListSafe);
|
||||
}
|
||||
return result;
|
||||
|
|
|
|||
|
|
@ -132,6 +132,21 @@ public class TypeConversion {
|
|||
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
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user