package com.changhong.epc.count.service.data.impl; import com.changhong.epc.bean.count.MasterInfo; import com.changhong.epc.constter.system.SystemClients; import com.changhong.epc.constter.system.UserInfo; import com.changhong.epc.constter.system.run.EpcRestInterface; import com.changhong.epc.constter.tenant.TenantUrlConst; import com.changhong.epc.count.mapper.tenant.system.SystemMathMapper; import com.changhong.epc.count.service.data.FormDataService; import com.iemsoft.framework.cloud.core.base.ResMsg; import com.iemsoft.framework.cloud.core.thread.Keys; import com.iemsoft.framework.cloud.core.thread.ThreadData; import com.iemsoft.framework.cloud.core.tools.JSONTool; import com.iemsoft.framework.cloud.core.tools.SpringUtil; import com.iemsoft.framework.cloud.ribbon.RestInterface; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.util.HashMap; @Service public class FormDataServiceImpl implements FormDataService,SystemClients { @Resource private SystemMathMapper systemMathMapper; @Override public Integer CountBudget(String formId,MasterInfo masterInfo, String date) { RestInterface restInterface = SpringUtil.getBean(SERVER_TENANT.getBeanName(), RestInterface.class); Object data = restInterface.post(TenantUrlConst.RESR_GETUSERCODE, new HashMap<>(), ResMsg.class, EpcRestInterface.getEpcHeads()).getData(); String man = JSONTool.toObj(JSONTool.toJson(data),UserInfo.class).getUserCode(); String formName = "formdata_"+ThreadData.get(Keys.TENANT_ID)+"_"+formId; return systemMathMapper.selectCountBudget(formName , man , masterInfo.getMeVal() , masterInfo.getAlias() , date); } }