|
|
@ -28,14 +28,18 @@ package com.yxt.pms.biz.pms.pmspurchasepay; |
|
|
|
import cn.hutool.core.bean.BeanUtil; |
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
import com.yxt.common.base.config.component.FileUploadComponent; |
|
|
|
import org.apache.commons.lang3.StringUtils; |
|
|
|
import com.yxt.common.base.service.MybatisBaseService; |
|
|
|
import com.yxt.common.base.utils.PagerUtil; |
|
|
|
import com.yxt.common.core.query.PagerQuery; |
|
|
|
import com.yxt.common.core.vo.PagerVo; |
|
|
|
|
|
|
|
import org.springframework.beans.factory.annotation.Autowired; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
import java.util.List; |
|
|
|
|
|
|
|
/** |
|
|
|
* Project: yxt-pms(采购) <br/> |
|
|
|
* File: PmsPurchasePayService.java <br/> |
|
|
@ -51,6 +55,10 @@ import org.springframework.stereotype.Service; |
|
|
|
*/ |
|
|
|
@Service |
|
|
|
public class PmsPurchasePayService extends MybatisBaseService<PmsPurchasePayMapper, PmsPurchasePay> { |
|
|
|
|
|
|
|
@Autowired |
|
|
|
private FileUploadComponent fileUploadComponent; |
|
|
|
|
|
|
|
private QueryWrapper<PmsPurchasePay> createQueryWrapper(PmsPurchasePayQuery query) { |
|
|
|
// todo: 这里根据具体业务调整查询条件
|
|
|
|
// 多字段Like示例:qw.and(wrapper -> wrapper.like("name", query.getName()).or().like("remark", query.getName()));
|
|
|
@ -79,6 +87,13 @@ public class PmsPurchasePayService extends MybatisBaseService<PmsPurchasePayMapp |
|
|
|
public void insertByDto(PmsPurchasePayDto dto){ |
|
|
|
PmsPurchasePay entity = new PmsPurchasePay(); |
|
|
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
|
|
List<String> filePaths = dto.getFilePaths(); |
|
|
|
String url = ""; |
|
|
|
for (String filePath : filePaths) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
url = url + filePath + ","; |
|
|
|
} |
|
|
|
entity.setFilePath(url); |
|
|
|
baseMapper.insert(entity); |
|
|
|
} |
|
|
|
|
|
|
@ -89,6 +104,13 @@ public class PmsPurchasePayService extends MybatisBaseService<PmsPurchasePayMapp |
|
|
|
} |
|
|
|
PmsPurchasePay entity = fetchBySid(dtoSid); |
|
|
|
BeanUtil.copyProperties(dto, entity, "id", "sid"); |
|
|
|
List<String> filePaths = dto.getFilePaths(); |
|
|
|
String url = ""; |
|
|
|
for (String filePath : filePaths) { |
|
|
|
filePath = filePath.replace(fileUploadComponent.getUrlPrefix(), ""); |
|
|
|
url = url + filePath + ","; |
|
|
|
} |
|
|
|
entity.setFilePath(url); |
|
|
|
baseMapper.updateById(entity); |
|
|
|
} |
|
|
|
|
|
|
@ -98,4 +120,8 @@ public class PmsPurchasePayService extends MybatisBaseService<PmsPurchasePayMapp |
|
|
|
BeanUtil.copyProperties(entity, vo); |
|
|
|
return vo; |
|
|
|
} |
|
|
|
|
|
|
|
public void delByMainSid(String dtoSid) { |
|
|
|
baseMapper.delByMainSid(dtoSid); |
|
|
|
} |
|
|
|
} |