Merge remote-tracking branch 'origin/develop_master' into develop_master

This commit is contained in:
super_liu
2021-08-08 12:55:07 +08:00
8 changed files with 44 additions and 20 deletions
@@ -40,8 +40,8 @@ public class TableToExcel {
Cell hCell=headRow.createCell(j++); Cell hCell=headRow.createCell(j++);
hCell.setCellValue(columnMap.get(key)); hCell.setCellValue(columnMap.get(key));
} }
//从第行开始填充数据 //从第行开始填充数据
int c=2; int c=1;
for(int k=i*sheetRow;k<dataList.size()&&k<(i+1)*sheetRow;k++) { for(int k=i*sheetRow;k<dataList.size()&&k<(i+1)*sheetRow;k++) {
T t=dataList.get(k); T t=dataList.get(k);
Row dataRow=sheet.createRow(c++); Row dataRow=sheet.createRow(c++);
@@ -27,8 +27,8 @@ public class LawsDto {
@ApiModelProperty(value = "主键") @ApiModelProperty(value = "主键")
private String id; private String id;
@ExcelProperty(value = "标准", index = 0) @ExcelProperty(value = "标准号", index = 0)
@ApiModelProperty(value = "标准") @ApiModelProperty(value = "标准号")
private String standNumber; private String standNumber;
@ExcelProperty(value = "中文名称", index = 1) @ExcelProperty(value = "中文名称", index = 1)
@@ -125,8 +125,28 @@ public class SarStandProjectLibraryController extends BaseController<SarStandPro
@PostMapping("/deleteByIds") @PostMapping("/deleteByIds")
@ApiOperation("批量删除标准") @ApiOperation("批量删除标准")
public ResponseMessage deleteByIds(String id){ public ResponseMessage deleteByIds(String id){
//从 项目id-标准id,项目id-标准id 拆分成 一个个 项目id-标准id
String[] ids = id.split(","); 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); sarStandProjectLibraryService.deleteByIds(list);
return Result.success("200","删除成功"); 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.SarStandProjectLibrary;
import com.adc.da.slrs.sarStandProjectLibrary.entity.StandProjectRelationDto; import com.adc.da.slrs.sarStandProjectLibrary.entity.StandProjectRelationDto;
import com.baomidou.mybatisplus.core.mapper.BaseMapper; import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import org.apache.ibatis.annotations.Param; import org.apache.ibatis.annotations.Param;
import java.util.List; import java.util.List;
@@ -17,7 +16,7 @@ import java.util.List;
* @since 2021-06-15 * @since 2021-06-15
*/ */
public interface SarStandProjectLibraryDao extends BaseMapper<SarStandProjectLibrary> { public interface SarStandProjectLibraryDao extends BaseMapper<SarStandProjectLibrary> {
// List<SarStandProjectLibrary> queryProjectManagerPage(@Param("current") int current, @Param("pageSize") int pageSize); List<SarStandProjectLibrary> queryProjectManagerPage(@Param("current") int current, @Param("pageSize") int pageSize);
void deleteByIds(@Param("ids") List<String> ids); void deleteByIds(@Param("ids") List<StandProjectRelationDto> ids);
void batchInsert(@Param("list") List<StandProjectRelationDto> list); void batchInsert(@Param("list") List<StandProjectRelationDto> list);
} }
@@ -14,7 +14,7 @@ public interface SarStandProjectLibraryService {
List<SarStandProjectLibrary> queryByProductLine(String productLine); List<SarStandProjectLibrary> queryByProductLine(String productLine);
List<SarStandProjectLibrary> queryStandId(String standId); List<SarStandProjectLibrary> queryStandId(String standId);
IPage<StandAttrInfoDto> queryStandInfo(int current, int pageSize, 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); void batchInsert(@Param("ids") List<StandProjectRelationDto> list);
List<StandAttrInfoDto> exportStandAttrInfoExcel(StandAttrInfoExcelDto standAttrInfoExcelDto,String standId); List<StandAttrInfoDto> exportStandAttrInfoExcel(StandAttrInfoExcelDto standAttrInfoExcelDto,String standId);
@@ -39,7 +39,8 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
@Resource @Resource
private IDicTypeEOService iDicTypeEOService; private IDicTypeEOService iDicTypeEOService;
@Override @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(); SarStandProjectLibrary sar = new SarStandProjectLibrary();
sar.setProjectPlatfor(sarDto.getProjectPlatfor()); sar.setProjectPlatfor(sarDto.getProjectPlatfor());
sar.setProjectNumber(sarDto.getProjectNumber()); sar.setProjectNumber(sarDto.getProjectNumber());
@@ -80,7 +81,8 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
return getSarStandProjectLibraryIPage(current, pageSize, wrapper); return getSarStandProjectLibraryIPage(current, pageSize, wrapper);
} }
@Override @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(); SarStandProjectLibrary sar = new SarStandProjectLibrary();
sar.setProjectPlatfor(sarDto.getProjectPlatfor()); sar.setProjectPlatfor(sarDto.getProjectPlatfor());
sar.setProjectNumber(sarDto.getProjectNumber()); sar.setProjectNumber(sarDto.getProjectNumber());
@@ -202,13 +204,15 @@ public class SarStandProjectLibraryServiceImpl extends ServiceImpl<SarStandProje
return userIPage; return userIPage;
} }
@Override @Override
public void deleteByIds(List<String> ids) { public void deleteByIds(List<StandProjectRelationDto> ids) {
sarStandProjectLibraryDao.deleteByIds(ids); sarStandProjectLibraryDao.deleteByIds(ids);
} }
@Override @Override
public void batchInsert(List<StandProjectRelationDto> list) { public void batchInsert(List<StandProjectRelationDto> list) {
sarStandProjectLibraryDao.batchInsert(list); sarStandProjectLibraryDao.batchInsert(list);
} }
@Override @Override
public List<StandAttrInfoDto> exportStandAttrInfoExcel(StandAttrInfoExcelDto standAttrInfoExcelDto ,String id) { public List<StandAttrInfoDto> exportStandAttrInfoExcel(StandAttrInfoExcelDto standAttrInfoExcelDto ,String id) {
List<String> ids = standAttrInfoExcelDto.getIds(); List<String> ids = standAttrInfoExcelDto.getIds();
@@ -19,10 +19,10 @@
</select> </select>
<delete id="deleteByIds"> <delete id="deleteByIds">
delete from sar_stand_project_relation where stand_id in ( delete from sar_stand_project_relation where
<foreach collection="ids" item="list" separator=","> <foreach collection="ids" item="list" separator="or">
#{list} ( project_id= #{list.projectId} and stand_id = #{list.standId} )
</foreach> </foreach>
)
</delete> </delete>
</mapper> </mapper>
@@ -480,11 +480,12 @@
SELECT * FROM( SELECT * FROM(
SELECT temp_user.*, ROWNUM rn SELECT temp_user.*, ROWNUM rn
FROM( FROM(
SELECT TEMP.* FROM ( SELECT TEMP.* ,
@rowno:=@rowno+1 as ROWNUM FROM (
SELECT 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, 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, 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 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, 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) LEFT JOIN TS_ORG tor ON (tor. ID = tuo.org_id and tor.VALID_FLAG = 0)
<include refid="Base_Where_Clause_2"/> <include refid="Base_Where_Clause_2"/>
GROUP BY tu.usid GROUP BY tu.usid
) TEMP ) TEMP ,(select @rowno:=0) ts
ORDER BY TEMP.modify_time DESC,TEMP.usid ORDER BY TEMP.modify_time DESC,TEMP.usid
) temp_user ) temp_user
WHERE ROWNUM &lt;= ${pager.endIndex} ) a WHERE ROWNUM &lt;= ${pager.endIndex} ) a