Merge branch 'develop_1' into 'develop_master'

Develop 1

See merge request !96
This commit is contained in:
王夏晖
2021-08-08 03:02:43 +00:00
8 changed files with 44 additions and 20 deletions
@@ -40,8 +40,8 @@ public class TableToExcel {
Cell hCell=headRow.createCell(j++);
hCell.setCellValue(columnMap.get(key));
}
//从第行开始填充数据
int c=2;
//从第行开始填充数据
int c=1;
for(int k=i*sheetRow;k<dataList.size()&&k<(i+1)*sheetRow;k++) {
T t=dataList.get(k);
Row dataRow=sheet.createRow(c++);
@@ -27,8 +27,8 @@ public class LawsDto {
@ApiModelProperty(value = "主键")
private String id;
@ExcelProperty(value = "标准", index = 0)
@ApiModelProperty(value = "标准")
@ExcelProperty(value = "标准号", index = 0)
@ApiModelProperty(value = "标准号")
private String standNumber;
@ExcelProperty(value = "中文名称", index = 1)
@@ -125,8 +125,28 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
@PostMapping("/deleteByIds")
@ApiOperation("批量删除标准")
public ResponseMessage deleteByIds(String id){
//从 项目id-标准id,项目id-标准id 拆分成 一个个 项目id-标准id
String[] ids = id.split(",");
List<String> list = Arrays.asList(ids);
String proId = null;
String standId = null;
//声明List
List<StandProjectRelationDto> list = new ArrayList<>();
for (int i=0;i< ids.length;i++){
StandProjectRelationDto standProjectRelationDto = new StandProjectRelationDto();
//引入一个变量来记录"-"的位置
int breakPosition = ids[i].indexOf("-");
//proId 项目id 是从头开始到分隔符为止的字符串
proId = ids[i].substring(0,breakPosition);
//standId 标准id 是从分隔符+1位开始到结束为止的字符串
standId = ids[i].substring(breakPosition+1);
//把项目id赋值
standProjectRelationDto.setProjectId(proId);
//把标准id赋值
standProjectRelationDto.setStandId(standId);
//把值放到list里
list.add(standProjectRelationDto);
}
sarStandProjectLibraryService.deleteByIds(list);
return Result.success("200","删除成功");
}
@@ -3,7 +3,6 @@ package com.adc.da.slrs.sarStandProjectLibrary.dao;
import com.adc.da.slrs.sarStandProjectLibrary.entity.SarStandProjectLibrary;
import com.adc.da.slrs.sarStandProjectLibrary.entity.StandProjectRelationDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param;
import java.util.List;
@@ -17,7 +16,7 @@ import java.util.List;
* @since 2021-06-15
*/
public interface SarStandProjectLibraryDao extends BaseMapper<SarStandProjectLibrary> {
// List<SarStandProjectLibrary> queryProjectManagerPage(@Param("current") int current, @Param("pageSize") int pageSize);
void deleteByIds(@Param("ids") List<String> ids);
List<SarStandProjectLibrary> queryProjectManagerPage(@Param("current") int current, @Param("pageSize") int pageSize);
void deleteByIds(@Param("ids") List<StandProjectRelationDto> ids);
void batchInsert(@Param("list") List<StandProjectRelationDto> list);
}
@@ -14,7 +14,7 @@ public interface SarStandProjectLibraryService {
List<SarStandProjectLibrary> queryByProductLine(String productLine);
List<SarStandProjectLibrary> queryStandId(String standId);
IPage<StandAttrInfoDto> queryStandInfo(int current, int pageSize, String standId);
void deleteByIds(List<String> ids);
void deleteByIds(List<StandProjectRelationDto> ids);
void batchInsert(@Param("ids") List<StandProjectRelationDto> list);
List<StandAttrInfoDto> exportStandAttrInfoExcel(StandAttrInfoExcelDto standAttrInfoExcelDto,String standId);
@@ -39,7 +39,8 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
@Resource
private IDicTypeEOService iDicTypeEOService;
@Override
public IPage<SarStandProjectLibrary> queryMaintenanceProject(int current, int pageSize, SarStandProjectLibraryDto sarDto) {
public IPage<SarStandProjectLibrary> queryMaintenanceProject(int current, int pageSize,
SarStandProjectLibraryDto sarDto) {
SarStandProjectLibrary sar = new SarStandProjectLibrary();
sar.setProjectPlatfor(sarDto.getProjectPlatfor());
sar.setProjectNumber(sarDto.getProjectNumber());
@@ -80,7 +81,8 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
return getSarStandProjectLibraryIPage(current, pageSize, wrapper);
}
@Override
public IPage<SarStandProjectLibrary> queryNotMaintenanceProject(int current, int pageSize, SarStandProjectLibraryDto sarDto) {
public IPage<SarStandProjectLibrary> queryNotMaintenanceProject(int current, int pageSize,
SarStandProjectLibraryDto sarDto) {
SarStandProjectLibrary sar = new SarStandProjectLibrary();
sar.setProjectPlatfor(sarDto.getProjectPlatfor());
sar.setProjectNumber(sarDto.getProjectNumber());
@@ -202,13 +204,15 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
return userIPage;
}
@Override
public void deleteByIds(List<String> ids) {
public void deleteByIds(List<StandProjectRelationDto> ids) {
sarStandProjectLibraryDao.deleteByIds(ids);
}
@Override
public void batchInsert(List<StandProjectRelationDto> list) {
sarStandProjectLibraryDao.batchInsert(list);
}
@Override
public List<StandAttrInfoDto> exportStandAttrInfoExcel(StandAttrInfoExcelDto standAttrInfoExcelDto ,String id) {
List<String> ids = standAttrInfoExcelDto.getIds();
@@ -19,10 +19,10 @@
</select>
<delete id="deleteByIds">
delete from sar_stand_project_relation where stand_id in (
<foreach collection="ids" item="list" separator=",">
#{list}
delete from sar_stand_project_relation where
<foreach collection="ids" item="list" separator="or">
( project_id= #{list.projectId} and stand_id = #{list.standId} )
</foreach>
)
</delete>
</mapper>
@@ -480,11 +480,12 @@
SELECT * FROM(
SELECT temp_user.*, ROWNUM rn
FROM(
SELECT TEMP.* FROM (
SELECT TEMP.* ,
@rowno:=@rowno+1 as ROWNUM FROM (
SELECT
TU.usid,max(TU.USER_TYPE) as USER_TYPE,max(TU."ACCOUNT") as ACCOUNT,MAX(TU.UNAME) AS UNAME,MAX(TU.EMAIL) AS
TU.usid,max(TU.USER_TYPE) as USER_TYPE,max(TU.ACCOUNT) as ACCOUNT,MAX(TU.UNAME) AS UNAME,MAX(TU.EMAIL) AS
EMAIL,MAX(TU.WORK_NUM) AS WORK_NUM,
MAX(TU.DISABLE_FLAG) AS DISABLE_FLAG,MAX(tu.modify_time) AS modify_time,MAX(tr."NAME") AS
MAX(TU.DISABLE_FLAG) AS DISABLE_FLAG,MAX(tu.modify_time) AS modify_time,MAX(tr.NAME) AS
ROLE_NAME,MAX(tui.mobile_phone)AS mobile_phone,
MAX(tui.office_phone) AS office_phone,MAX(tui.ADDRESS) AS ADDRESS,MAX(tui.FAX_ADDRESS) AS
FAX_ADDRESS,MAX(tor.org_name) AS org_name,
@@ -499,7 +500,7 @@
LEFT JOIN TS_ORG tor ON (tor. ID = tuo.org_id and tor.VALID_FLAG = 0)
<include refid="Base_Where_Clause_2"/>
GROUP BY tu.usid
) TEMP
) TEMP ,(select @rowno:=0) ts
ORDER BY TEMP.modify_time DESC,TEMP.usid
) temp_user
WHERE ROWNUM &lt;= ${pager.endIndex} ) a