|
@@ -3,7 +3,9 @@ package com.usoftchina.saas.document.service.impl;
|
|
|
import com.github.pagehelper.PageHelper;
|
|
import com.github.pagehelper.PageHelper;
|
|
|
import com.github.pagehelper.PageInfo;
|
|
import com.github.pagehelper.PageInfo;
|
|
|
import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
|
|
import com.usoftchina.saas.base.service.CommonBaseServiceImpl;
|
|
|
|
|
+import com.usoftchina.saas.commons.api.MessageLogService;
|
|
|
import com.usoftchina.saas.commons.dto.ComboDTO;
|
|
import com.usoftchina.saas.commons.dto.ComboDTO;
|
|
|
|
|
+import com.usoftchina.saas.commons.dto.DocBaseDTO;
|
|
|
import com.usoftchina.saas.commons.dto.ListReqDTO;
|
|
import com.usoftchina.saas.commons.dto.ListReqDTO;
|
|
|
import com.usoftchina.saas.commons.exception.BizExceptionCode;
|
|
import com.usoftchina.saas.commons.exception.BizExceptionCode;
|
|
|
import com.usoftchina.saas.context.BaseContextHolder;
|
|
import com.usoftchina.saas.context.BaseContextHolder;
|
|
@@ -22,7 +24,9 @@ import org.springframework.util.StringUtils;
|
|
|
import java.text.ParseException;
|
|
import java.text.ParseException;
|
|
|
import java.text.SimpleDateFormat;
|
|
import java.text.SimpleDateFormat;
|
|
|
import java.util.Date;
|
|
import java.util.Date;
|
|
|
|
|
+import java.util.HashMap;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
+import java.util.Map;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* @author heqw
|
|
* @author heqw
|
|
@@ -34,6 +38,8 @@ public class BankinformationServiceImpl extends CommonBaseServiceImpl<Bankinform
|
|
|
private BankinformationMapper bankinformationMapper;
|
|
private BankinformationMapper bankinformationMapper;
|
|
|
@Autowired
|
|
@Autowired
|
|
|
private BanksubledgerMapper banksubledgerMapper;
|
|
private BanksubledgerMapper banksubledgerMapper;
|
|
|
|
|
+ @Autowired
|
|
|
|
|
+ private MessageLogService messageLogService;
|
|
|
|
|
|
|
|
@Transactional
|
|
@Transactional
|
|
|
@Override
|
|
@Override
|
|
@@ -87,11 +93,31 @@ public class BankinformationServiceImpl extends CommonBaseServiceImpl<Bankinform
|
|
|
@Transactional
|
|
@Transactional
|
|
|
@Override
|
|
@Override
|
|
|
public boolean removeByPrimaryKey(int id){
|
|
public boolean removeByPrimaryKey(int id){
|
|
|
- bankinformationMapper.deleteByPrimaryKey(id);
|
|
|
|
|
- banksubledgerMapper.deleteByBankid(id);
|
|
|
|
|
|
|
+ DocBaseDTO docBaseDTO = getBaseDTOById(id);
|
|
|
|
|
+ Map<String, Object> map = new HashMap<String, Object>();
|
|
|
|
|
+ map.put("v_id",id);
|
|
|
|
|
+ map.put("v_code", docBaseDTO.getCode());
|
|
|
|
|
+ map.put("v_type","bank");
|
|
|
|
|
+ map.put("v_companyid",BaseContextHolder.getCompanyId());
|
|
|
|
|
+ map.put("v_res","");
|
|
|
|
|
+ bankinformationMapper.check(map);
|
|
|
|
|
+ Object result = map.get("v_res");
|
|
|
|
|
+ if(!StringUtils.isEmpty(result)){
|
|
|
|
|
+ throw new BizException(BizExceptionCode.USING_EXISTS.getCode(),result.toString());
|
|
|
|
|
+ }else {
|
|
|
|
|
+ bankinformationMapper.deleteByPrimaryKey(id);
|
|
|
|
|
+ banksubledgerMapper.deleteByBankid(id);
|
|
|
|
|
+ //日志
|
|
|
|
|
+ messageLogService.delete(docBaseDTO);
|
|
|
|
|
+ }
|
|
|
return true;
|
|
return true;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ private DocBaseDTO getBaseDTOById(int id) {
|
|
|
|
|
+ String code = bankinformationMapper.selectByPrimaryKey(id).getBk_bankcode();
|
|
|
|
|
+ DocBaseDTO baseDTO = new DocBaseDTO(Long.valueOf(String.valueOf(id)), code, "BankInformation");
|
|
|
|
|
+ return baseDTO;
|
|
|
|
|
+ }
|
|
|
@Override
|
|
@Override
|
|
|
public PageInfo<Bankinformation> selectList(PageRequest page, ListReqDTO condition) {
|
|
public PageInfo<Bankinformation> selectList(PageRequest page, ListReqDTO condition) {
|
|
|
//设置默认分页
|
|
//设置默认分页
|