调整商学院凭证查询,不查询指标表中的id和金额,改为查询凭证内容中的指标id和金额

This commit is contained in:
hecan 2024-08-30 10:12:30 +08:00
parent c501b0418e
commit 8ed181f7ff
6 changed files with 28 additions and 29 deletions

View File

@ -113,8 +113,8 @@ public class GbiZbxmbServiceImpl extends BaseService<GbiZbxmbEntity, String> imp
gbiZbxmbEntity.setSfjz("0");//是否结转
gbiZbxmbEntity.setCyskzfs("0");//超预算控制方式
gbiZbxmbEntity.setYjbfb(100.00);//预警百分比
gbiZbxmbEntity.setPfrid(-1);//批复人id
gbiZbxmbEntity.setShrid(-1);//审核人id
//gbiZbxmbEntity.setPfrid(-1);//批复人id
//gbiZbxmbEntity.setShrid(-1);//审核人id
gbiZbxmbEntity.setSjly(1);//数据来源
gbiZbxmbEntity.setXfzt("0");//下发状态
gbiZbxmbEntity.setNcysy(0.00);//年初已使用

View File

@ -265,8 +265,6 @@
pzml.idpzh as idpzh,
pzml.kjqj as kjqj,
pzml.srrq as srrq,
pzml.srID as srID,
pznr.bmdm as bmdm,
pzml.pzzy as pzzy,
sum(pznr.je) as pzje,
pzml.gsdm,pzml.zth,pzml.kjqj,pzml.pzh
@ -280,7 +278,7 @@
pzml.kjqj,
pzml.srrq,
pzml.pzzy,
pzml.gsdm,pzml.zth,pzml.kjqj,pzml.pzh,pzml.srID,pznr.bmdm
pzml.gsdm,pzml.zth,pzml.kjqj,pzml.pzh
</select>

View File

@ -1,6 +1,5 @@
package com.hzya.frame.grpU8.nxproof.glPzml.service.impl;
import cn.hutool.core.bean.BeanUtil;
import cn.hutool.core.date.DateUtil;
import cn.hutool.core.util.StrUtil;
import cn.hutool.http.HttpRequest;
@ -8,8 +7,6 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONArray;
import com.alibaba.fastjson.JSONObject;
import com.hzya.frame.basedao.service.impl.BaseService;
import com.hzya.frame.grpU8.nxproof.gbizbxmb.dao.IGbiZbxmbDao;
import com.hzya.frame.grpU8.nxproof.gbizbxmb.entity.GbiZbxmbEntity;
import com.hzya.frame.grpU8.nxproof.glPzml.dao.ISenderGlPzmlDao;
import com.hzya.frame.grpU8.nxproof.glPzml.entity.SenderGlPzmlEntity;
import com.hzya.frame.grpU8.nxproof.glPzml.service.ISenderGlPzmlService;
@ -18,10 +15,7 @@ import com.hzya.frame.grpU8.nxproof.glPznr.entity.SenderGlPznrEntity;
import com.hzya.frame.web.entity.BaseResult;
import com.hzya.frame.web.entity.JsonResultEntity;
import org.apache.commons.collections.CollectionUtils;
import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Service;
import java.math.BigDecimal;
@ -45,8 +39,6 @@ public class SenderGlPzmlServiceImpl extends BaseService<SenderGlPzmlEntity, Str
private static String URL="http://192.168.42.22/";//正式环境
private ISenderGlPzmlDao senderGlPzmlDao;
@Autowired
private IGbiZbxmbDao gbiZbxmbDao;
@Autowired
public void setSenderGlPzmlDao(ISenderGlPzmlDao dao) {
@ -681,6 +673,7 @@ public class SenderGlPzmlServiceImpl extends BaseService<SenderGlPzmlEntity, Str
if(StrUtil.isEmpty(glPzmlEntity.getKjqj())){
glPzmlEntity.setKjqj(DateUtil.format(new Date(),"yyyyMM"));
}
//glPzmlEntity.setIdpzh("0C69E35D-912A-48F7-A5D4-F73227CC75B6");
//获取token
String token = getToken();
if(StrUtil.isEmpty(token)){
@ -708,29 +701,26 @@ public class SenderGlPzmlServiceImpl extends BaseService<SenderGlPzmlEntity, Str
jsonObjectParams.put("code",pzmlEntity.getIdpzh());//pzid
jsonObjectParams.put("budgetYear",pzmlEntity.getKjqj().substring(0,4));//预算年度
jsonObjectParams.put("applyDate",outputDateString);//日期
jsonObjectParams.put("userCode",pzmlEntity.getSrid());//用户编码
jsonObjectParams.put("depCode","A518");//部门编码
jsonObjectParams.put("description",pzmlEntity.getPzzy());//说明
jsonObjectParams.put("amount",roundedValue.doubleValue());//金额
jsonObjectParams.put("pzNum",pzNum);//凭证号 例如公司代码+账套号+会计期间+凭证号001_001_202408_付款_1
//根据idpzh查询指标id和指标金额
GbiZbxmbEntity gbiZbxmbEntity=new GbiZbxmbEntity();
gbiZbxmbEntity.setDjId(pzmlEntity.getIdpzh());
gbiZbxmbEntity.setKjnd(pzmlEntity.getKjqj().substring(0,4));
gbiZbxmbEntity.setDataSourceCode(glPzmlEntity.getDataSourceCode());
List<GbiZbxmbEntity> gbiZbsyrecEntities = gbiZbxmbDao.queryZbxmbByIdpzh(gbiZbxmbEntity);
logger.info("=======根据凭证idpzh:{}查询的指标金额和指标id数据有{}条",pzmlEntity.getIdpzh(),gbiZbsyrecEntities.size());
if(CollectionUtils.isEmpty(gbiZbsyrecEntities)){
//根据idpzh查询指标id和指标金额以及部门经济科目
SenderGlPznrEntity senderGlPznrEntity=new SenderGlPznrEntity();
senderGlPznrEntity.setIdpzh(pzmlEntity.getIdpzh());
senderGlPznrEntity.setDataSourceCode(glPzmlEntity.getDataSourceCode());
List<SenderGlPznrEntity> senderGlPznrEntities = senderGlPznrDao.queryGlPznrSxy(senderGlPznrEntity);
logger.info("=======根据凭证idpzh:{}查询的指标金额和指标id以及部门经济科目数据有{}条",pzmlEntity.getIdpzh(),senderGlPznrEntities.size());
if(CollectionUtils.isEmpty(senderGlPznrEntities)){
jsonObjectParams.put("reimburseItems",new ArrayList<>());
}else{
JSONArray jsonArray=new JSONArray();
for (GbiZbxmbEntity zbxmbEntity : gbiZbsyrecEntities) {
BigDecimal bigDecimalValueZbxmb = new BigDecimal(zbxmbEntity.getJe());
for (SenderGlPznrEntity glPznrEntity : senderGlPznrEntities) {
BigDecimal bigDecimalValueZbxmb = new BigDecimal(glPznrEntity.getJe());
BigDecimal roundedValueZbxmb = bigDecimalValueZbxmb.setScale(2, RoundingMode.HALF_UP);
JSONObject jsonObjectZbxm=new JSONObject();
jsonObjectZbxm.put("thirdProjectCode",zbxmbEntity.getZbid());
jsonObjectZbxm.put("thirdProjectCode",glPznrEntity.getZbid());
jsonObjectZbxm.put("amount",roundedValueZbxmb);
jsonObjectZbxm.put("financialCode",zbxmbEntity.getJjkmdm());
jsonObjectZbxm.put("financialCode",glPznrEntity.getFzdm5());
jsonArray.add(jsonObjectZbxm);
}
jsonObjectParams.put("reimburseItems",jsonArray);
@ -763,7 +753,7 @@ public class SenderGlPzmlServiceImpl extends BaseService<SenderGlPzmlEntity, Str
String params = jsonObject.toJSONString();
logger.info("=========获取凭证token请求参数:{}========",params);
String urlToken="nky/service/session/getAccessToken";
String result = HttpRequest.post(URLTest + urlToken).header("Content-Type", "soap/xml").timeout(30000).body(params).execute().body();
String result = HttpRequest.post(URLTest + urlToken).header("Content-Type", "application/json;charset=UTF-8").timeout(30000).body(params).execute().body();
logger.info("=========获取凭证token返回结果:{}========",result);
JSONObject jsonObjectResult=JSONObject.parseObject(result);
String value=jsonObjectResult.getString("value");
@ -774,7 +764,6 @@ public class SenderGlPzmlServiceImpl extends BaseService<SenderGlPzmlEntity, Str
return accessToken;
}
return null;
}

View File

@ -95,5 +95,7 @@ public interface ISenderGlPznrDao extends IBaseDao<SenderGlPznrEntity, String> {
Integer deleteGlPznrHealthBureau(SenderGlPznrEntity senderGlPznrEntity);
List<SenderGlPznrEntity> querySenderGlPznrEntityByIdpzh(SenderGlPznrEntity senderGlPznrEntity);
List<SenderGlPznrEntity> queryGlPznrSxy(SenderGlPznrEntity senderGlPznrEntity);
}

View File

@ -76,6 +76,12 @@ public class SenderGlPznrDaoImpl extends MybatisGenericDao<SenderGlPznrEntity, S
return o;
}
@Override
@DS("#senderGlPznrEntity.dataSourceCode")
public List<SenderGlPznrEntity> queryGlPznrSxy(SenderGlPznrEntity senderGlPznrEntity) {
return (List<SenderGlPznrEntity>)super.selectList("queryGlPznrSxy",senderGlPznrEntity);
}
}

View File

@ -473,6 +473,10 @@
</trim>
</select>
<select id="queryGlPznrSxy" resultMap="get-SenderGlPznrEntity-result" parameterType = "com.hzya.frame.grpU8.nxproof.glPznr.entity.SenderGlPznrEntity">
select je,fzdm5,zbid from gl_pznr where zbid !=0 and idpzh=#{idpzh}
</select>
<!--新增所有列-->
<insert id="entity_insert" parameterType = "com.hzya.frame.grpU8.nxproof.glPznr.entity.SenderGlPznrEntity" keyProperty="" useGeneratedKeys="true">
insert into gl_pznr(