This commit is contained in:
huangzj
2023-06-25 15:41:43 +08:00
parent 75f5e8b464
commit dfcd291b68
9 changed files with 107 additions and 12 deletions

View File

@@ -14,6 +14,7 @@ import com.njcn.csharmonic.service.CsConfigurationService;
import com.njcn.oss.utils.FileStorageUtil;
import com.njcn.user.api.UserFeignClient;
import com.njcn.user.pojo.po.User;
import com.njcn.web.utils.RequestUtil;
import lombok.RequiredArgsConstructor;
import org.apache.commons.lang.StringUtils;
import org.springframework.beans.BeanUtils;
@@ -64,9 +65,10 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
public boolean audit(CsConfigurationParm.CsConfigurationAuditParam auditParm) {
CsConfigurationPO csConfigurationPO = new CsConfigurationPO();
NjcnBeanUtil.copyPropertiesIgnoreCase(auditParm,csConfigurationPO);
String s = fileStorageUtil.uploadStream(writeJsonStringToInputStream(auditParm.getFileContent()), HarmonicConstant.CONFIGURATIONPATH, HarmonicConstant.CONFIGURATIONNAME);
csConfigurationPO.setImagePath(s);
if(!Objects.isNull(auditParm.getFileContent())){
String s = fileStorageUtil.uploadStream(writeJsonStringToInputStream(auditParm.getFileContent()), HarmonicConstant.CONFIGURATIONPATH, HarmonicConstant.CONFIGURATIONNAME);
csConfigurationPO.setImagePath(s);
}
boolean b = this.updateById(csConfigurationPO);
@@ -77,6 +79,8 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
public IPage<CsConfigurationVO> queryPage(CsConfigurationParm.CsConfigurationQueryParam csConfigurationQueryParam) {
Page<CsConfigurationVO> returnpage = new Page<> (csConfigurationQueryParam.getPageNum(), csConfigurationQueryParam.getPageSize ( ));
Page<CsConfigurationPO> temppage = new Page<> (csConfigurationQueryParam.getPageNum(), csConfigurationQueryParam.getPageSize ( ));
String deptIndex = RequestUtil.getDeptIndex();
QueryWrapper<CsConfigurationPO> query = new QueryWrapper<>();
query.like(StringUtils.isNotBlank(csConfigurationQueryParam.getSearchValue()),CsConfigurationPO.COL_NAME,csConfigurationQueryParam.getSearchValue()).
@@ -98,7 +102,7 @@ public class CsConfigurationServiceImpl extends ServiceImpl<CsConfigurationMappe
CsConfigurationVO csDevModelPageVO = new CsConfigurationVO();
BeanUtils.copyProperties(page, csDevModelPageVO);
if(Objects.isNull(page.getImagePath())){
csDevModelPageVO.setFileContent("");
csDevModelPageVO.setFileContent(null);
}else {
InputStream fileStream = fileStorageUtil.getFileStream(page.getImagePath());

View File

@@ -111,8 +111,8 @@ public class CsPagePOServiceImpl extends ServiceImpl<CsPagePOMapper, CsPagePO> i
QueryWrapper<CsPagePO> queryWrapper = new QueryWrapper<>();
queryWrapper.eq(StringUtils.isNotBlank (csPageParam.getPid()),CsPagePO.COL_PID,csPageParam.getPid()).
like(StringUtils.isNotBlank (csPageParam.getSearchValue()),CsPagePO.COL_NAME,csPageParam.getSearchValue()).
eq ("status",1);
// orderByDesc(CsPagePO.COL_CREATE_TIME);
eq ("status",1).
orderByAsc(CsPagePO.COL_KID);
IPage<CsPagePO> pageData = this.page(new Page<>(csPageParam.getPageNum(), csPageParam.getPageSize()), queryWrapper);
List<String> collect1 = pageData.getRecords().stream().map(CsPagePO::getCreateBy).collect(Collectors.toList());