修改mapper文件

release
yishiqihuasheng 2 years ago
parent bd61d3519c
commit e0f4ea5a1e
  1. 1
      dxhy-admin/src/main/java/com/dxhy/admin/sys/dao/SysDeptDao.java
  2. 1
      dxhy-admin/src/main/java/com/dxhy/admin/sys/service/SysDeptService.java
  3. 14
      dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/LoginServiceImpl.java
  4. 5
      dxhy-admin/src/main/java/com/dxhy/admin/sys/service/impl/SysDeptServiceImpl.java
  5. 7
      dxhy-admin/src/main/resources/mapper/sys/SysDeptDao.xml
  6. 23
      dxhy-base/src/main/java/com/dxhy/base/controller/BaseInvoiceController.java
  7. 2
      dxhy-base/src/main/java/com/dxhy/base/model/BaseFpRzRespVO.java
  8. 9
      dxhy-base/src/main/resources/mapper/BaseFpZhMapper.xml
  9. 14
      dxhy-base/src/main/resources/mapper/BaseSggxcxMapper.xml
  10. 20
      dxhy-common/src/main/java/com/dxhy/common/util/UserInfoUtil.java
  11. 4
      dxhy-common/src/main/java/com/dxhy/common/vo/UserInfo.java

@ -98,4 +98,5 @@ public interface SysDeptDao extends BaseMapper<SysDeptEntity> {
@Param("aceKey") String aceKey, @Param("aceId") String aceId, @Param("dbName") String dbName,
@Param("qsStatus") String qsStatus);
List<String> getOrgCodeList(Long userId);
}

@ -188,4 +188,5 @@ public interface SysDeptService extends IService<SysDeptEntity> {
SysDeptEntity queryDeptTaxno(String company, String taxno);
List<String> getOrgCodeList(Long userId);
}

@ -7,14 +7,11 @@ import java.util.Set;
import javax.annotation.Resource;
import com.dxhy.admin.sys.entity.*;
import org.apache.commons.lang3.StringUtils;
import org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder;
import org.springframework.stereotype.Service;
import com.dxhy.admin.sys.entity.SysDeptEntity;
import com.dxhy.admin.sys.entity.SysUserBusinessEntity;
import com.dxhy.admin.sys.entity.SysUserEntity;
import com.dxhy.admin.sys.entity.SysUserOrgEntity;
import com.dxhy.admin.sys.service.*;
import com.dxhy.common.constant.DbConstant;
import com.dxhy.common.constant.RedisConstant;
@ -170,6 +167,15 @@ public class LoginServiceImpl implements LoginService {
}
log.debug("是否签收后认证:{} , 数据源:{} , 系统类型:{}", userInfo.getQsStatus(), userInfo.getDbName(),
userInfo.getProductType());
List<SysCompanyEntity> sysCompanyEntities = sysUserOrgService.getOrgsByUserId(userEntity.getUserId());
List<String> orgs = new ArrayList<>();
if (sysCompanyEntities != null && sysCompanyEntities.size() > 0){
for (SysCompanyEntity sysCompanyEntity : sysCompanyEntities) {
orgs.add(sysCompanyEntity.getCompanyCode());
}
}
userInfo.setCompanyCodes(orgs);
}
return userInfo;
} catch (Exception e) {

@ -345,4 +345,9 @@ public class SysDeptServiceImpl extends ServiceImpl<SysDeptDao, SysDeptEntity> i
.eq("org_type", SysConfig.OrgType.ORG_TYPE_5.getCode()));
}
@Override
public List<String> getOrgCodeList(Long userId) {
return baseMapper.getOrgCodeList(userId);
}
}

@ -80,5 +80,12 @@
order by a.org_code
</select>
<select id="getOrgCodeList" parameterType="long" resultType="string">
select d.org_code
from sys_user_org o left join sys_dept d
on o.dept_id = d.dept_id
where o.userid = #{userId}
</select>
</mapper>

@ -94,6 +94,7 @@ public class BaseInvoiceController extends AbstractController {
@Resource
private BaseIntelligentizeCheckService baseIntelligentizeCheckService;
private static final Pattern PATTERN_DATE = Pattern.compile(
"^(?:(?!0000)[0-9]{4}-(?:(?:0[1-9]|1[0-2])-(?:0[1-9]|1[0-9]|2[0-8])|(?:0[13-9]|1[0-2])-(?:29|30)|(?:0[13578]|1[02])-31)|(?:[0-9]{2}(?:0[48]|[2468][048]|[13579][26])|(?:0[48]|[2468][048]|[13579][26])00)-02-29)$");
private static final Pattern PATTERN_AMOUNT = Pattern.compile("^(([1-9]{1}\\d*)|([0]{1}))(\\.(\\d){0,2})?$");
@ -108,6 +109,7 @@ public class BaseInvoiceController extends AbstractController {
@SysLog("调用发票认证综合查询入口接口")
public Object listRzFpxx(@RequestBody Map<String, Object> map) {
String gfsh = (String)map.get("gfsh");
String companyCode = (String) map.get("companyCode");
String invoiceType = (String)map.get("invoiceType");
String invoiceSource = (String)map.get("invoiceSource");
String kpksrq = (String)map.get("kpksrq");
@ -185,6 +187,14 @@ public class BaseInvoiceController extends AbstractController {
gfshList = UserInfoUtil.getGfshAll(getUserInfo().getOrg());
}
pramsMap.put("gfsh", gfshList);
//所属组织
List<String> companyCodeList = new ArrayList<>();
if (StringUtils.isNotBlank(companyCode) && !"99".equals(companyCode)){
companyCodeList.add(companyCode);
}else {
companyCodeList = getUserInfo().getCompanyCodes();
}
pramsMap.put("companyCodes",companyCodeList);
if (!StringHelper.isBlank(invoiceType)) {
if (!"99".equals(invoiceType)) {
pramsMap.put("invoiceType", invoiceType);
@ -459,6 +469,7 @@ public class BaseInvoiceController extends AbstractController {
String menuId = (String)map.get("menuId");
String bzdh = (String) map.get("bzdh");
String inAccountStatus = (String) map.get("inAccountStatus");
String companyCode = (String) map.get("companyCode");
// //所属机构列表
// List<String> orgCodes = null;
// if (map.get("orgCodes") !=null){
@ -520,6 +531,17 @@ public class BaseInvoiceController extends AbstractController {
}
pramsMap.put("gfsh", gfshList);
//所属组织
List<String> companyCodeList = new ArrayList<>();
if (StringUtils.isNotBlank(companyCode) && !"99".equals(companyCode)){
companyCodeList.add(companyCode);
}else {
companyCodeList = getUserInfo().getCompanyCodes();
log.info("获取到的组织信息{}",companyCodeList);
}
pramsMap.put("companyCodes",companyCodeList);
if (!StringUtils.isBlank(invoiceType)) {
if (!"99".equals(invoiceType)) {
pramsMap.put("invoiceType", invoiceType);
@ -591,7 +613,6 @@ public class BaseInvoiceController extends AbstractController {
}
if (!StringUtils.isBlank(xfmc)) {
pramsMap.put("xfmc", xfmc);
}

@ -205,6 +205,8 @@ public class BaseFpRzRespVO implements Serializable {
private String imageId;
//报账单号
private String bzdh;
//组织名称
private String deptName;
}

@ -6,6 +6,7 @@
<resultMap id="BaseResultMap"
type="com.dxhy.base.model.BaseFpRzRespVO">
<result column="id" property="id"/>
<result column="deptName" property="deptName"/>
<result column="invoice_code" property="invoiceCode"/>
<result column="invoice_no" property="invoiceNo"/>
<result column="kprq" property="invoiceDate"/>
@ -80,6 +81,10 @@
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
and t.comp_code in
<foreach collection="companyCodes" index="index" item="companyCode" open="(" separator="," close=")">
#{companyCode}
</foreach>
<if test="invoiceStatus != null and invoiceStatus != '' and invoiceStatus != 'null' ">
and t.invoice_status = #{invoiceStatus}
</if>
@ -333,6 +338,10 @@
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
and t.comp_code in
<foreach collection="companyCodes" index="index" item="companyCode" open="(" separator="," close=")">
#{companyCode}
</foreach>
<if
test="invoiceStatus != null and invoiceStatus != '' and invoiceStatus != 'null' ">
and t.invoice_status = #{invoiceStatus}

@ -5,6 +5,7 @@
<resultMap id="SggxcxResultMap" type="com.dxhy.base.entity.BaseTDxRecordInvoice">
<result column="id" property="id"/>
<result column="dept_name" property="deptName"/>
<result column="invoice_code" property="invoiceCode"/>
<result column="invoice_no" property="invoiceNo"/>
<result column="gf_name" property="gfName"/>
@ -56,7 +57,7 @@
</select>
<select id="selectSggxcx" parameterType="java.util.Map"
resultMap="SggxcxResultMap" databaseId="mysql">
select t.invoice_type,t.dept_id
select t.invoice_type,t.dept_id,t.dept_name
,t.id,t.invoice_code,t.invoice_no,t.gf_name,t.gf_tax_no,t.xf_name,
DATE_FORMAT(t.invoice_date,'%Y-%m-%d')invoice_date,t.invoice_amount,t.tax_amount,t.invoice_status,DATE_FORMAT(t.qs_date,'%Y-%m-%d')qs_date
,t.qs_type,t.qs_status,t.dk_tax_amount,t.qs_name,t.sn_voucher_number,t.posting_time,t.image_id,t.account_period,
@ -91,6 +92,10 @@
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
and t.comp_code in
<foreach collection="companyCodes" index="index" item="companyCode" open="(" close=")" separator=",">
#{companyCode}
</foreach>
<if test="qszt != null and qszt != '' and qszt != 'null' ">
and t.qs_status = #{qszt}
</if>
@ -360,6 +365,9 @@
and t.auth_status in('0','5','6')
and t.export_mark = '0'
and t.company = #{company}
<!-- <if test="companyCode != null and companyCode != '' and companyCode != 'null' and companyCode != 99" >-->
<!-- t.comp_code = #{companyCode}-->
<!-- </if>-->
<if test="sfkrz != '99' and sfkrz != null and sfkrz != '' and sfkrz != 'null' and sfkrz == '1'.toString()">
and t.invoice_status in ('0','7')
and t.invoice_amount>0
@ -379,6 +387,10 @@
<foreach collection="gfsh" index="index" item="item" open="(" separator="," close=")">
#{item}
</foreach>
and t.comp_code in
<foreach collection="companyCodes" index="index" item="companyCode" open="(" close=")" separator=",">
#{companyCode}
</foreach>
<if test="qszt != null and qszt != '' and qszt != 'null' ">
and t.qs_status = #{qszt}
</if>

@ -4,6 +4,7 @@ import java.util.ArrayList;
import java.util.List;
import com.dxhy.common.vo.Tax;
import com.dxhy.common.vo.TaxOrgCode;
/**
* 根据业务处理把用户信息处理成需要的形式
@ -32,6 +33,25 @@ public class UserInfoUtil {
return gfshList;
}
/**
*
* @param orgCodes
* 机构编码
*
*
*/
public static List<String> getOrgCodeAll(List<TaxOrgCode> orgCodes) {
List<String> orgCodeList = new ArrayList<>();
if (orgCodes != null && orgCodes.size() > 0) {
for (TaxOrgCode taxOrgCode : orgCodes) {
String orgCode = taxOrgCode.getOrgCode();
orgCodeList.add(orgCode);
}
}
return orgCodeList;
}
/**
* 把登录人的公司信息转换成购方名称列表用于业务操作
*

@ -67,6 +67,10 @@ public class UserInfo implements Serializable {
* 业务单元
*/
private List<Business> business;
/**
* 组织编码
*/
private List<String> companyCodes;
/**
* 用户类型 1--购方用户 2--供应商
*/

Loading…
Cancel
Save