| | |
| | | |
| | | import com.product.administration.config.CmnConst; |
| | | import com.product.administration.service.ide.ICustomerInfoService; |
| | | import com.product.common.lang.StringUtils; |
| | | import com.product.core.dao.BaseDao; |
| | | import com.product.core.entity.DataTableEntity; |
| | | import com.product.core.entity.FieldSetEntity; |
| | |
| | | */ |
| | | public DataTableEntity listCustomerInfo(Integer cpage,Integer pageSize,FieldSetEntity fse) { |
| | | //数据权限 |
| | | // String dataFilter=permissionService.getDataFilter(CmnConst.CREATED_BY) ; |
| | | String dataFilter=permissionService.getDataFilter(CmnConst.CREATED_BY); |
| | | //高级查询 |
| | | String searchFilter=queryFilterService.getQueryFilter(fse); |
| | | |
| | | // if(!StringUtils.isEmpty(dataFilter)) { |
| | | // if (!StringUtils.isEmpty(searchFilter)) { |
| | | // dataFilter+=" AND "+ searchFilter; |
| | | // } |
| | | // }else { |
| | | // if (!StringUtils.isEmpty(searchFilter)) { |
| | | // dataFilter=searchFilter; |
| | | // } |
| | | // StringBuilder sbSql = new StringBuilder(); |
| | | // sbSql.append("SELECT \n"); |
| | | // sbSql.append(" A.uuid,A.customer_name, A.customer_manager, A.customer_manager_leader,A.business_agent, \n"); |
| | | // sbSql.append(" CONCAT(B.linkman, '-', B.mobile) AS customer_contact \n"); |
| | | // sbSql.append("FROM product_project_customer A \n"); |
| | | // sbSql.append("LEFT JOIN product_project_customer_sub B ON B.customer_uuid = A.uuid \n"); |
| | | // if (!BaseUtil.strIsNull(searchFilter)) { |
| | | // sbSql.append("WHERE ").append(searchFilter); |
| | | // } |
| | | |
| | | if(!BaseUtil.strIsNull(dataFilter)) { |
| | | if (!BaseUtil.strIsNull(searchFilter)) { |
| | | dataFilter+=" AND "+ searchFilter; |
| | | } |
| | | }else { |
| | | if (!BaseUtil.strIsNull(searchFilter)) { |
| | | dataFilter=searchFilter; |
| | | } |
| | | } |
| | | |
| | | DataTableEntity dt=baseDao.listTable(CmnConst.product_project_CUSTOMER, searchFilter, null, null, null, pageSize, cpage); |
| | | DataTableEntity dt=baseDao.listTable(CmnConst.PRODUCT_PROJECT_CUSTOMER, searchFilter, null, null, null, pageSize, cpage); |
| | | // DataTableEntity dt = baseDao.listTable(sbSql.toString(), new Object[] {}, pageSize, cpage); |
| | | baseDao.loadPromptData(dt); |
| | | return dt; |
| | | } |
| | |
| | | * @return |
| | | */ |
| | | public FieldSetEntity findCustomerInfo(String uuid) { |
| | | FieldSetEntity fieldSetEntity = baseDao.getFieldSetEntity(CmnConst.product_project_CUSTOMER, uuid, true); |
| | | FieldSetEntity fieldSetEntity = baseDao.getFieldSetEntity(CmnConst.PRODUCT_PROJECT_CUSTOMER, uuid, true); |
| | | FieldSetEntity fse = this.findCustomerValue(uuid); |
| | | fieldSetEntity.setValue("money", fse.getString("money")); |
| | | fieldSetEntity.setValue("returnedMoney", fse.getString("returnedMoney")); |
| | |
| | | */ |
| | | public FieldSetEntity contractProjectMakeMoney(String uuid) { |
| | | FieldSetEntity fieldSet = new FieldSetEntity(); |
| | | fieldSet.setTableName(CmnConst.product_project_CUSTOMER); |
| | | fieldSet.setTableName(CmnConst.PRODUCT_PROJECT_CUSTOMER); |
| | | //合同表 product_project_contract_info owner |
| | | DataTableEntity contractData = baseDao.listTable("product_project_contract_info"," owner = ? and flow_flag = 2 ",new Object[]{uuid}); |
| | | baseDao.loadPromptData(contractData); |
| | |
| | | */ |
| | | public FieldSetEntity findCustomerValue(String uuid) { |
| | | FieldSetEntity fieldSetEntity = new FieldSetEntity(); |
| | | fieldSetEntity.setTableName(CmnConst.product_project_CUSTOMER); |
| | | fieldSetEntity.setTableName(CmnConst.PRODUCT_PROJECT_CUSTOMER); |
| | | //查询合同金额 |
| | | StringBuffer moneySql = new StringBuffer(); |
| | | moneySql.append(" SELECT IFNULL(SUM(d.money),0) money FROM ( ") |
| | |
| | | */ |
| | | @Transactional |
| | | public boolean deleteCustomerInfo(String uuid) throws BaseException{ |
| | | return baseDao.delete(CmnConst.product_project_CUSTOMER, "uuid=?", new Object[] {uuid}); |
| | | String[] uuids = uuid.split(","); |
| | | return baseDao.delete(CmnConst.PRODUCT_PROJECT_CUSTOMER, BaseUtil.buildQuestionMarkFilter(CmnConst.UUID, uuids.length, true), uuids); |
| | | } |
| | | } |