Commit 615d3baa authored by yff's avatar yff

提交扫码附件接口

parent 85014ca2
...@@ -24,9 +24,9 @@ public class GpfkForBzgxFjController extends BaseController { ...@@ -24,9 +24,9 @@ public class GpfkForBzgxFjController extends BaseController {
private GpfkfjService gpfkfjService; private GpfkfjService gpfkfjService;
@ApiOperation(value = "扫码获取当前工票的操作附件") @ApiOperation(value = "扫码获取当前工票的操作附件")
@RequestMapping(value = "/queryFjBybzgx/{bzlx}/{type}") @RequestMapping(value = "/queryFjBybzgx/{woid}/{bzlx}/{type}")
public void doKwellGpfk(HttpServletRequest request, HttpServletResponse response, @PathVariable String bzlx, @PathVariable String type){ public void doKwellGpfk(HttpServletRequest request, HttpServletResponse response, @PathVariable String woid,@PathVariable String bzlx, @PathVariable String type){
Attachment file = gpfkfjService.queryBzgxFj(bzlx, type); Attachment file = gpfkfjService.queryBzgxFj(woid,bzlx, type);
if(file !=null) { if(file !=null) {
FileInputStream fileInputStream = attachmentService.download(file.getId()); FileInputStream fileInputStream = attachmentService.download(file.getId());
if(fileInputStream!=null) { if(fileInputStream!=null) {
...@@ -35,4 +35,5 @@ public class GpfkForBzgxFjController extends BaseController { ...@@ -35,4 +35,5 @@ public class GpfkForBzgxFjController extends BaseController {
} }
} }
} }
...@@ -9,7 +9,7 @@ import com.gavel.common.base.service.BaseEditService; ...@@ -9,7 +9,7 @@ import com.gavel.common.base.service.BaseEditService;
public interface GpfkfjService extends BaseEditService { public interface GpfkfjService extends BaseEditService {
public Attachment queryBzgxFj(String bzgxid,String type); public Attachment queryBzgxFj(String woid,String bzgxid,String type);
public void checkGxfjIfFitRule(MultipartFile multipartFile, String folderorpath,String groupid); public void checkGxfjIfFitRule(MultipartFile multipartFile, String folderorpath,String groupid);
} }
...@@ -15,6 +15,8 @@ import com.gavel.common.attachment.service.AttachmentService; ...@@ -15,6 +15,8 @@ import com.gavel.common.attachment.service.AttachmentService;
import com.gavel.common.base.service.impl.BaseEditServiceImpl; import com.gavel.common.base.service.impl.BaseEditServiceImpl;
import com.gavel.gygl.dao.BzgxDao; import com.gavel.gygl.dao.BzgxDao;
import com.gavel.gygl.persistent.Bzgx; import com.gavel.gygl.persistent.Bzgx;
import com.gavel.gygl.vo.GylxVO;
import com.gavel.kwell.dao.GpfkDao;
import com.gavel.kwell.service.GpfkfjService; import com.gavel.kwell.service.GpfkfjService;
...@@ -28,13 +30,13 @@ public class GpfkfjServiceImpl extends BaseEditServiceImpl implements GpfkfjServ ...@@ -28,13 +30,13 @@ public class GpfkfjServiceImpl extends BaseEditServiceImpl implements GpfkfjServ
private AttachmentService attachmentService; private AttachmentService attachmentService;
@Autowired @Autowired
private BzgxDao bzgxDao; private GpfkDao gpfkDao;
private static final String ZDS1_FLODER="gylx"; private static final String ZDS1_FLODER="gylx\\gyzyzdso";
private static final String ZDS2_FLODER="bzgx\\gyzyzdss"; private static final String ZDS2_FLODER="gylx\\gyzyzdss";
private static final String SP_FLODER="bzgx\\gyzyzdssp"; private static final String SP_FLODER="gylx\\gyzyzdssp";
private static final String ZDS1_BZ="O"; private static final String ZDS1_BZ="O";
private static final String ZDS2_BZ="T"; private static final String ZDS2_BZ="T";
private static final String SP_BZ="M"; private static final String SP_BZ="M";
...@@ -45,23 +47,24 @@ public class GpfkfjServiceImpl extends BaseEditServiceImpl implements GpfkfjServ ...@@ -45,23 +47,24 @@ public class GpfkfjServiceImpl extends BaseEditServiceImpl implements GpfkfjServ
@Override @Override
public Attachment queryBzgxFj(String bzgxid,String type) { public Attachment queryBzgxFj(String woid,String bzgxid,String type) {
Bzgx bzgxVo = bzgxDao.queryById(Bzgx.class, bzgxid); GylxVO gylxVO = gpfkDao.queryKwellWoStandGylx(woid, bzgxid);
if(bzgxVo!=null&&StringUtils.isNotEmpty(type)) { // Bzgx bzgxVo = bzgxDao.queryById(Bzgx.class, bzgxid);
if(gylxVO!=null&&StringUtils.isNotEmpty(type)) {
if(type.equals(ZDS1_BZ)) { if(type.equals(ZDS1_BZ)) {
List<Attachment> list =attachmentService.getAttachmentAndSubFolder(bzgxVo.getId(), ZDS1_FLODER); List<Attachment> list =attachmentService.getAttachmentAndSubFolder(gylxVO.getId(), ZDS1_FLODER);
if(list!=null&&list.size()>0) { if(list!=null&&list.size()>0) {
return list.get(0); return list.get(0);
} }
} }
else if(type.equals(ZDS2_BZ)) { else if(type.equals(ZDS2_BZ)) {
List<Attachment> list =attachmentService.getAttachmentAndSubFolder(bzgxVo.getId(), ZDS2_FLODER); List<Attachment> list =attachmentService.getAttachmentAndSubFolder(gylxVO.getId(), ZDS2_FLODER);
if(list!=null&&list.size()>0) { if(list!=null&&list.size()>0) {
return list.get(0); return list.get(0);
} }
} }
else if(type.equals(SP_BZ)) { else if(type.equals(SP_BZ)) {
List<Attachment> list =attachmentService.getAttachmentAndSubFolder(bzgxVo.getId(), SP_FLODER); List<Attachment> list =attachmentService.getAttachmentAndSubFolder(gylxVO.getId(), SP_FLODER);
if(list!=null&&list.size()>0) { if(list!=null&&list.size()>0) {
return list.get(0); return list.get(0);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment