parent
130580e31e
commit
7751d50a31
@ -1,17 +0,0 @@ |
||||
package com.dxhy.core.dao.frTask; |
||||
|
||||
|
||||
import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
||||
import com.dxhy.core.entity.frJob.VoucherRecordItemEntity; |
||||
import org.apache.ibatis.annotations.Mapper; |
||||
import org.apache.ibatis.annotations.Param; |
||||
|
||||
import java.util.List; |
||||
|
||||
@Mapper |
||||
public interface VoucherRecordItemDao extends BaseMapper<VoucherRecordItemEntity> { |
||||
|
||||
List<VoucherRecordItemEntity> getByTime(@Param("start")String start, |
||||
@Param("end") String end, |
||||
@Param("kjkmbh") String kjkmbh); |
||||
} |
@ -1,271 +0,0 @@ |
||||
package com.dxhy.core.entity.frJob; |
||||
|
||||
import com.baomidou.mybatisplus.annotation.IdType; |
||||
import com.baomidou.mybatisplus.annotation.TableId; |
||||
import com.baomidou.mybatisplus.annotation.TableName; |
||||
import lombok.Data; |
||||
|
||||
import java.io.Serializable; |
||||
|
||||
@Data |
||||
@TableName("voucher_record_item") |
||||
public class VoucherRecordItemEntity implements Serializable { |
||||
|
||||
private static final long serialVersionUID = 1L; |
||||
|
||||
@TableId(type = IdType.AUTO) |
||||
/** |
||||
* 主键 |
||||
*/ |
||||
private Long id; |
||||
|
||||
/** |
||||
* 和主键关联的id |
||||
*/ |
||||
private Long relationId; |
||||
|
||||
/** |
||||
* 行项目编码 |
||||
*/ |
||||
private String docln; |
||||
|
||||
/** |
||||
* 借贷标识 |
||||
*/ |
||||
private String drcrk; |
||||
|
||||
/** |
||||
* 借贷描述 s借 h贷 |
||||
*/ |
||||
private String zdrcrk; |
||||
|
||||
/** |
||||
* 科目编码 |
||||
*/ |
||||
private String racct; |
||||
|
||||
/** |
||||
* 科目描述 |
||||
*/ |
||||
private String txt50; |
||||
|
||||
/** |
||||
* 借方金额 |
||||
*/ |
||||
private String zwslj; |
||||
|
||||
/** |
||||
* 贷方金额 |
||||
*/ |
||||
private String zwsld; |
||||
|
||||
/** |
||||
* 公司代码货币 |
||||
*/ |
||||
private String rhcur; |
||||
|
||||
/** |
||||
* 交易货币 |
||||
*/ |
||||
private String rwcur; |
||||
|
||||
/** |
||||
* 本位币借方金额 |
||||
*/ |
||||
private String zhslj; |
||||
|
||||
/** |
||||
* 本位币贷方金额 |
||||
*/ |
||||
private String zhsld; |
||||
|
||||
/** |
||||
* 公司代码货币 |
||||
*/ |
||||
private String phcur; |
||||
|
||||
/** |
||||
* 供应商编码 |
||||
*/ |
||||
private String lifnr; |
||||
|
||||
/** |
||||
* 供应商名称 |
||||
*/ |
||||
private String zname; |
||||
|
||||
/** |
||||
* 客户编码 |
||||
*/ |
||||
private String kunnr; |
||||
|
||||
/** |
||||
* 物料编码 |
||||
*/ |
||||
private String matnr; |
||||
|
||||
/** |
||||
* 物料名称 |
||||
*/ |
||||
private String maktx; |
||||
|
||||
/** |
||||
* 客户名称 |
||||
*/ |
||||
private String zname2; |
||||
|
||||
/** |
||||
* 供应商名称 |
||||
*/ |
||||
private String zname1; |
||||
|
||||
/** |
||||
* 数量 |
||||
*/ |
||||
private String msl; |
||||
|
||||
/** |
||||
* 单位 |
||||
*/ |
||||
private String runit; |
||||
|
||||
/** |
||||
* 税码 |
||||
*/ |
||||
private String mwskz; |
||||
|
||||
/** |
||||
* 税率 |
||||
*/ |
||||
private String kbetr; |
||||
|
||||
/** |
||||
* 成本中心 |
||||
*/ |
||||
private String rcntr; |
||||
|
||||
/** |
||||
* 成本中心名称 |
||||
*/ |
||||
private String ktext; |
||||
|
||||
/** |
||||
* wbs编码 |
||||
*/ |
||||
private String psPosid; |
||||
|
||||
/** |
||||
* wbs名称 |
||||
*/ |
||||
private String post1; |
||||
|
||||
/** |
||||
* 订单编号 |
||||
*/ |
||||
private String aufnr; |
||||
|
||||
/** |
||||
* 订单描述 |
||||
*/ |
||||
private String zktext; |
||||
|
||||
/** |
||||
* 销售订单 |
||||
*/ |
||||
private String kdauf; |
||||
|
||||
/** |
||||
* 销售订单行 |
||||
*/ |
||||
private String kdpos; |
||||
|
||||
/** |
||||
* 是否是集成销售业务 |
||||
*/ |
||||
private String zzjcfflag; |
||||
|
||||
/** |
||||
* 资产编码 |
||||
*/ |
||||
private String anln1; |
||||
|
||||
/** |
||||
* 资产名称 |
||||
*/ |
||||
private String zaatxt50; |
||||
|
||||
/** |
||||
* 功能范围 |
||||
*/ |
||||
private String rfarea; |
||||
|
||||
/** |
||||
* 功能范围名称 |
||||
*/ |
||||
private String fkbtx; |
||||
|
||||
/** |
||||
* 矿别 |
||||
*/ |
||||
private String ktype; |
||||
|
||||
/** |
||||
* 是否是集成销售业务,如果有销售订单号,则认为是集成销售设置为x |
||||
*/ |
||||
private String zzjcflag; |
||||
|
||||
/** |
||||
* 矿别名称 |
||||
*/ |
||||
private String zkname; |
||||
|
||||
/** |
||||
* zzfld1 |
||||
*/ |
||||
private String zzfld1; |
||||
|
||||
/** |
||||
* zzfld2 |
||||
*/ |
||||
private String zzfld2; |
||||
|
||||
/** |
||||
* zzfld3 |
||||
*/ |
||||
private String zzfld3; |
||||
|
||||
/** |
||||
* zzfld4 |
||||
*/ |
||||
private String zzfld4; |
||||
|
||||
/** |
||||
* zzfld5 |
||||
*/ |
||||
private String zzfld5; |
||||
|
||||
/** |
||||
* zzfld6 |
||||
*/ |
||||
private String zzfld6; |
||||
|
||||
/** |
||||
* zzfld7 |
||||
*/ |
||||
private String zzfld7; |
||||
|
||||
/** |
||||
* zzfld8 |
||||
*/ |
||||
private String zzfld8; |
||||
|
||||
/** |
||||
* zzfld9 |
||||
*/ |
||||
private String zzfld9; |
||||
|
||||
/** |
||||
* zzfld10 |
||||
*/ |
||||
private String zzfld10; |
||||
} |
@ -1,8 +0,0 @@ |
||||
package com.dxhy.core.service.frJob; |
||||
|
||||
import java.text.ParseException; |
||||
|
||||
public interface VoucherRecordItemService { |
||||
|
||||
boolean refreshTax(); |
||||
} |
@ -1,59 +0,0 @@ |
||||
package com.dxhy.core.service.frJob; |
||||
|
||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
||||
import com.dxhy.common.constant.DbConstant; |
||||
import com.dxhy.common.datasource.config.DynamicContextHolder; |
||||
import com.dxhy.core.dao.frTask.VoucherRecordItemDao; |
||||
import com.dxhy.core.enmu.KjkmTaxEnmu; |
||||
import com.dxhy.core.entity.frJob.VoucherRecordItemEntity; |
||||
import lombok.extern.slf4j.Slf4j; |
||||
import org.springframework.stereotype.Service; |
||||
import javax.annotation.Resource; |
||||
import java.text.SimpleDateFormat; |
||||
import java.util.Calendar; |
||||
import java.util.Date; |
||||
import java.util.List; |
||||
import java.util.Map; |
||||
|
||||
@Service("voucherRecordItemService") |
||||
@Slf4j |
||||
public class VoucherRecordItemServiceImpl extends ServiceImpl<VoucherRecordItemDao, VoucherRecordItemEntity> implements VoucherRecordItemService { |
||||
|
||||
@Resource |
||||
private VoucherRecordItemDao voucherRecordItemDao; |
||||
|
||||
@Resource |
||||
private QueryDetailDataService queryDetailDataService; |
||||
private static final String JXZZS = "22210101"; |
||||
|
||||
private static final String XXZZS = "22210102"; |
||||
|
||||
|
||||
@Override |
||||
public boolean refreshTax(){ |
||||
try { |
||||
String[] jxTime = queryDetailDataService.getTime(JXZZS); |
||||
//查询进项数据
|
||||
List<VoucherRecordItemEntity> jxVoucherRecordItems = voucherRecordItemDao.getByTime(jxTime[0], jxTime[1], JXZZS); |
||||
//税率枚举
|
||||
Map<String, String> taxMap = KjkmTaxEnmu.getTaxMap(); |
||||
if (jxVoucherRecordItems != null && jxVoucherRecordItems.size() != 0){ |
||||
jxVoucherRecordItems.stream().forEach(e->e.setKbetr(taxMap.get(e.getRacct()))); |
||||
this.updateBatchById(jxVoucherRecordItems); |
||||
} |
||||
String[] xxTime = queryDetailDataService.getTime(XXZZS); |
||||
//查询销项数据
|
||||
List<VoucherRecordItemEntity> xxVoucherRecordItems = voucherRecordItemDao.getByTime(xxTime[0], xxTime[1], XXZZS); |
||||
if (xxVoucherRecordItems != null && xxVoucherRecordItems.size() != 0){ |
||||
xxVoucherRecordItems.stream().forEach(e->e.setKbetr(taxMap.get(e.getRacct()))); |
||||
this.updateBatchById(xxVoucherRecordItems); |
||||
} |
||||
}catch (Exception e){ |
||||
e.printStackTrace(); |
||||
log.error("税率刷新时错误信息为{}",e.getMessage()); |
||||
return false; |
||||
} |
||||
|
||||
return true; |
||||
} |
||||
} |
@ -1,20 +0,0 @@ |
||||
<?xml version="1.0" encoding="UTF-8" ?> |
||||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd" > |
||||
<mapper namespace="com.dxhy.core.dao.frTask.VoucherRecordItemDao"> |
||||
|
||||
<resultMap id="RecordToQuery" type="com.dxhy.core.entity.frJob.VoucherRecordItemEntity"> |
||||
<id property="id" column="id"/> |
||||
<result property="racct" column="racct"/> |
||||
</resultMap> |
||||
<select id="getByTime" resultMap="RecordToQuery"> |
||||
SELECT |
||||
i.id, |
||||
i.racct |
||||
FROM |
||||
voucher_record_item i |
||||
LEFT JOIN voucher_record v |
||||
ON v.id = i.relation_id |
||||
where DATE_FORMAT(v.create_time,'%Y-%m-%d %H:%i:%s') between #{start} and #{end} |
||||
and i.racct like CONCAT(#{kjkmbh},'%') |
||||
</select> |
||||
</mapper> |
Loading…
Reference in new issue