package com.product.contract.service; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.product.contract.config.CmnConst; import com.product.contract.service.ide.IProjectBusinessService; import com.product.core.dao.BaseDao; import com.product.core.entity.DataTableEntity; import com.product.core.entity.FieldSetEntity; import com.product.core.service.support.AbstractBaseService; import com.product.core.transfer.Transactional; import com.product.util.BaseUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; @Service public class ProjectBusinessService extends AbstractBaseService implements IProjectBusinessService { @Autowired public BaseDao baseDao; @Override public JSONObject findProject(FieldSetEntity fse) { FieldSetEntity fsData = baseDao.getFieldSet(CmnConst.PRODUCT_PROJECT_BUSINESS, fse.getUUID(), false); //计算整体项目进度 String sql ="SELECT CONCAT(sum(REPLACE(a.task_rate, '%', ''))/COUNT(*),'%') task_rate FROM `product_project_schedule_weekly_sub` a\n" + "LEFT JOIN product_project_schedule_weekly b on a.main_uuid=b.uuid\n" + "where a.project_uuid=? and b.flow_flag =2 GROUP BY project_uuid"; FieldSetEntity task_rate_fs = baseDao.getFieldSetEntityBySQL(sql, new String[]{fse.getUUID()}, false); if (!FieldSetEntity.isEmpty(task_rate_fs)){ fsData.setValue("schedule",task_rate_fs.getString("task_rate")); } //封装项目计划数据接口 JSONObject json = new JSONObject(); DataTableEntity planData=baseDao.listTable(CmnConst.PRODUCT_PROJECT_BUSINESS_PLAN,"project_uuid=?",new String[]{fse.getUUID()}); for (int i = 0; i